diff --git a/api/@ohos.application.AccessibilityExtensionAbility.d.ts b/api/@ohos.application.AccessibilityExtensionAbility.d.ts index 14fff65e81854d5ac7ec1d5a4f8b7e37e89c9eb7..12add9c4facf542b2564913ad09bc88ec37962ca 100644 --- a/api/@ohos.application.AccessibilityExtensionAbility.d.ts +++ b/api/@ohos.application.AccessibilityExtensionAbility.d.ts @@ -71,8 +71,7 @@ declare interface AccessibilityEvent { * @since 9 * @syscap SystemCapability.BarrierFree.Accessibility.Core */ - declare class GesturePath { - constructor(durationTime: number) + declare interface GesturePath { /** * Indicates the position of the points that make up the gesture. */ @@ -88,8 +87,7 @@ declare interface AccessibilityEvent { * @since 9 * @syscap SystemCapability.BarrierFree.Accessibility.Core */ -declare class GesturePoint { - constructor(positionX: number, positionY: number) +declare interface GesturePoint { /** * Indicates the X coordinate of point. */ diff --git a/api/@ohos.bundle.d.ts b/api/@ohos.bundle.d.ts index ec5b14f035fca2cb7dbd47147b425baab1165f2e..0b2eff47d641a924da0e2dcaff70dcd78bb5046d 100644 --- a/api/@ohos.bundle.d.ts +++ b/api/@ohos.bundle.d.ts @@ -773,7 +773,7 @@ declare namespace bundle { * @syscap SystemCapability.BundleManager.BundleFramework * @param bundleName Indicates the bundle name of the application. * @param moduleName Indicates the module name of the application. - * @param isNeedUpdate Indicates isNeedUpdate of the application. + * @param upgradeFlag Indicates upgradeFlag of the application. * @systemapi Hide this for inner system use */ function setModuleUpgradeFlag(bundleName: string, moduleName: string, upgradeFlag: UpgradeFlag, callback: AsyncCallback):void; diff --git a/api/@ohos.commonEvent.d.ts b/api/@ohos.commonEvent.d.ts index 7b732362cceebaf3c654dc8fe95ae392e1e2d122..9b00d6108b26a3b218ee92b893ef0f7d8105561f 100644 --- a/api/@ohos.commonEvent.d.ts +++ b/api/@ohos.commonEvent.d.ts @@ -965,7 +965,7 @@ declare namespace commonEvent { * This is a protected common event that can only be sent by system. * @since 9 */ - COMMON_EVENT_SLOT_CHANGE = "usual.event.SLOT_CHANGE" + COMMON_EVENT_SLOT_CHANGE = "usual.event.SLOT_CHANGE", /** * Indicate the action of a common event that the spn display information has been updated. diff --git a/api/@ohos.distributedMissionManager.d.ts b/api/@ohos.distributedMissionManager.d.ts new file mode 100755 index 0000000000000000000000000000000000000000..fb832ffd226d777468fa676d86e83f2390f237e4 --- /dev/null +++ b/api/@ohos.distributedMissionManager.d.ts @@ -0,0 +1,76 @@ +/* + * 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 { MissionCallback } from './application/MissionCallbacks'; +import { MissionDeviceInfo } from './application/MissionDeviceInfo'; +import { MissionParameter } from './application/MissionParameter'; + +/** + * This module provides the capability to manage abilities and obtaining system task information for distributed + * scenario. + * @name distributedMissionManager + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @permission ohos.permission.MANAGE_MISSIONS + * @systemapi Hide this for inner system use. + */ +declare namespace distributedMissionManager { + /** + * Start sync missions from remote device. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission. + * @param parameter Parameters corresponding to mission. + * @systemapi Hide this for inner system use. + */ + function startSyncRemoteMissions(parameter: MissionParameter, callback: AsyncCallback): void; + function startSyncRemoteMissions(parameter: MissionParameter): Promise; + + /** + * Stop sync missions from remote device. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission. + * @param parameter Parameters corresponding to mission. + * @systemapi Hide this for inner system use. + */ + function stopSyncRemoteMissions(parameter: MissionDeviceInfo, callback: AsyncCallback): void; + function stopSyncRemoteMissions(parameter: MissionDeviceInfo): Promise; + + /** + * Register the missionListener to ams. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param parameter Parameters corresponding to mission. + * @param options The callbacks for regist mission. + * @systemapi Hide this for inner system use. + */ + function registerMissionListener(parameter: MissionDeviceInfo, options: MissionCallback, callback: AsyncCallback): void; + function registerMissionListener(parameter: MissionDeviceInfo, options: MissionCallback): Promise; + + /** + * Unrgister the missionListener to ams. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param parameter Parameters corresponding to mission. + * @systemapi Hide this for inner system use. + */ + function unRegisterMissionListener(parameter: MissionDeviceInfo, callback:AsyncCallback): void; + function unRegisterMissionListener(parameter: MissionDeviceInfo): Promise; +} +export default distributedMissionManager; diff --git a/api/@ohos.i18n.d.ts b/api/@ohos.i18n.d.ts index 3693f83823e3db93ccb2b912b3f5bbe2b561d13b..d7dafe4aed7e6a6544fe56bf9a16bd6c004239e8 100644 --- a/api/@ohos.i18n.d.ts +++ b/api/@ohos.i18n.d.ts @@ -246,7 +246,7 @@ export class PhoneNumberFormat { * @return Returns a string represents phone number's location. * @since 9 */ - static getLocationName(number: string, locale: string): string; + getLocationName(number: string, locale: string): string; } /** diff --git a/api/@ohos.multimedia.image.d.ts b/api/@ohos.multimedia.image.d.ts index 17ec79142ed591e0d7857796a99dee567bbd9605..682810e42a1e44d52631ad591eff152b5944fbd4 100644 --- a/api/@ohos.multimedia.image.d.ts +++ b/api/@ohos.multimedia.image.d.ts @@ -503,6 +503,34 @@ declare namespace image { scaleMode?: ScaleMode; } + /** + * Initialization options for ImageSource. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + */ + interface SourceOptions { + /** + * The density for ImageSource. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + */ + sourceDensity: number; + + /** + * PixelMap expected format. + * @since 8 + * @syscap SystemCapability.Multimedia.Image.Core + */ + sourcePixelFormat?: PixelMapFormat; + + /** + * PixelMap size. + * @since 8 + * @syscap SystemCapability.Multimedia.Image.Core + */ + sourceSize?: Size; + } + /** * Create pixelmap by data buffer. * @since 8 @@ -526,6 +554,16 @@ declare namespace image { */ function createImageSource(uri: string): ImageSource; + /** + * Creates an ImageSource instance based on the URI. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.ImageSource + * @param uri Image source URI. + * @param options The config of Image source. + * @return Returns the ImageSource instance if the operation is successful; returns null otherwise. + */ + function createImageSource(uri: string, options: SourceOptions): ImageSource; + /** * Creates an ImageSource instance based on the file descriptor. * @since 7 @@ -535,6 +573,16 @@ declare namespace image { */ function createImageSource(fd: number): ImageSource; + /** + * Creates an ImageSource instance based on the file descriptor. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.ImageSource + * @param fd ID of a file descriptor. + * @param options The config of Image source. + * @return Returns the ImageSource instance if the operation is successful; returns null otherwise. + */ + function createImageSource(fd: number, options: SourceOptions): ImageSource; + /** * Creates an ImageSource instance based on the buffer. * @since 9 @@ -544,6 +592,16 @@ declare namespace image { */ function createImageSource(buf: ArrayBuffer): ImageSource; + /** + * Creates an ImageSource instance based on the buffer. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.ImageSource + * @param buf The buffer of the iamge. + * @param options The config of Image source. + * @return Returns the ImageSource instance if the operation is successful; returns null otherwise. + */ + function createImageSource(buf: ArrayBuffer, options: SourceOptions): ImageSource; + /** * Creates an ImageSource instance based on the buffer in incremental. * @since 9 @@ -553,6 +611,16 @@ declare namespace image { */ function CreateIncrementalSource(buf: ArrayBuffer): ImageSource; + /** + * Creates an ImageSource instance based on the buffer in incremental. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.ImageSource + * @param buf The buffer of the iamge. + * @param options The config of source. + * @return Returns the ImageSource instance if the operation is successful; returns null otherwise. + */ + function CreateIncrementalSource(buf: ArrayBuffer, options?: SourceOptions): ImageSource; + /** * Creates an ImagePacker instance. * @since 6 @@ -697,6 +765,144 @@ declare namespace image { */ getPixelBytesNumber(): number; + /** + * Obtains the density of the image pixel map. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @return The number of density. + */ + getDensity():number; + + /** + * Set the transparent rate of pixel map. This method uses a callback to return the operation result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param rate The value of transparent rate. + * @param callback Callback used to return the operation result. If the operation fails, an error message is returned. + */ + opacity(rate: number, callback: AsyncCallback): void; + + /** + * Set the transparent rate of pixel map. This method uses a promise to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param rate The value of transparent rate. + * @return A Promise instance used to return the operation result. If the operation fails, an error message is returned. + */ + opacity(rate: number): Promise; + + /** + * Obtains new pixel map with allpha information. This method uses a promise to return the information. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @return A Promise instance used to return the new image pixel map. If the operation fails, an error message is returned. + */ + createAlphaPixelmap(): Promise; + + /** + * Obtains new pixel map with allpha information. This method uses a callback to return the information. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param callback Callback used to return the new image pixel map. If the operation fails, an error message is returned. + */ + createAlphaPixelmap(callback: AsyncCallback): void; + + /** + * Image zoom in width and height. This method uses a callback to return the operation result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param x The zoom value of width. + * @param y The zoom value of height. + * @param callback Callback used to return the operation result. If the operation fails, an error message is returned. + */ + scale(x: number, y: number, callback: AsyncCallback): void; + + /** + * Image zoom in width and height. This method uses a promise to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param x The zoom value of width. + * @param y The zoom value of height. + * @return A Promise instance used to return the operation result. If the operation fails, an error message is returned. + */ + scale(x: number, y: number): Promise; + + /** + * Image position transformation. This method uses a callback to return the operation result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param x The position value of width. + * @param y The position value of height. + * @param callback Callback used to return the operation result. If the operation fails, an error message is returned. + */ + translate(x: number, y: number, callback: AsyncCallback): void; + + /** + * Image position transformation. This method uses a promise to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param x The position value of width. + * @param y The position value of height. + * @return A Promise instance used to return the operation result. If the operation fails, an error message is returned. + */ + translate(x: number, y: number): Promise; + + /** + * Image rotation. This method uses a callback to return the operation result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param angle The rotation angle. + * @param callback Callback used to return the operation result. If the operation fails, an error message is returned. + */ + rotate(angle: number, callback: AsyncCallback): void; + + /** + * Image rotation. This method uses a promise to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param angle The rotation angle. + * @return A Promise instance used to return the operation result. If the operation fails, an error message is returned. + */ + rotate(angle: number): Promise; + + /** + * Image flipping. This method uses a callback to return the operation result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param horizontal Is flip in horizontal. + * @param vertical Is flip in vertical. + * @param callback Callback used to return the operation result. If the operation fails, an error message is returned. + */ + flip(horizontal: boolean, vertical: boolean, callback: AsyncCallback): void; + + /** + * Image flipping. This method uses a promise to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param horizontal Is flip in horizontal. + * @param vertical Is flip in vertical. + * @return A Promise instance used to return the operation result. If the operation fails, an error message is returned. + */ + flip(horizontal: boolean, vertical: boolean): Promise; + + /** + * Crop the image. This method uses a callback to return the operation result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param region The region to crop. + * @param callback Callback used to return the operation result. If the operation fails, an error message is returned. + */ + crop(region: Region, callback: AsyncCallback): void; + + /** + * Crop the image. This method uses a promise to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Image.Core + * @param region The region to crop. + * @return A Promise instance used to return the operation result. If the operation fails, an error message is returned. + */ + crop(region: Region): Promise; + /** * Releases this PixelMap object. This method uses a callback to return the result. * @since 7 diff --git a/api/@ohos.uitest.d.ts b/api/@ohos.uitest.d.ts index 9b40a88f3884e7f891273d672b56448f26b0acb6..237ac9e7896e5482c8579cf74b494f94edfe236d 100644 --- a/api/@ohos.uitest.d.ts +++ b/api/@ohos.uitest.d.ts @@ -471,6 +471,24 @@ class UiComponent{ * @test */ dragTo(target: UiComponent): Promise; + + /** + * Pinch enlarge this {@link UiComponent} to the target scale. + * @syscap SystemCapability.Test.UiTest + * @param scale the scale of the pinch enlarge this {@link UiComponent}'s size. + * @since 9 + * @test + */ + pinchOut(scale: number): Promise; + + /** + * Pinch shrink this {@link UiComponent} to the target scale. + * @syscap SystemCapability.Test.UiTest + * @param scale the scale of the pinch shrink this {@link UiComponent}'s size. + * @since 9 + * @test + */ + pinchIn(scale: number): Promise; } /** diff --git a/api/@ohos.util.d.ts b/api/@ohos.util.d.ts index ea00afe0705860e3a1e29303ec61239bb45005b1..f3f42ea249fa30585f6ce7c5218294bd8d5efef8 100644 --- a/api/@ohos.util.d.ts +++ b/api/@ohos.util.d.ts @@ -64,10 +64,21 @@ declare namespace util { */ function callbackWrapper(original: Function): (err: Object, value: Object) => void; + /** + * Takes a function following the common error-first callback style, i.e taking an (err, value) => + * 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 version that returns promises + */ + function promiseWrapper(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 * @syscap SystemCapability.Utils.Lang * @param original asynchronous function * @return return a version that returns promises diff --git a/api/application/AbilityRunningInfo.d.ts b/api/application/AbilityRunningInfo.d.ts index 6ffba2b8246e826e32c33e769b02dc4f8471b0b6..864465c87b22972ca735b6293fb3b5ad2e39de80 100644 --- a/api/application/AbilityRunningInfo.d.ts +++ b/api/application/AbilityRunningInfo.d.ts @@ -1,75 +1,75 @@ -/* - * 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 { ElementName } from '../bundle/elementName'; -import abilityManager from '../@ohos.application.abilityManager'; - -/** - * The class of an ability running information. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - * @permission N/A - */ -export interface AbilityRunningInfo { - /** - * @default ability element name - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - ability: ElementName; - - /** - * @default process id - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - pid: number; - - /** - * @default user id - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - uid: number; - - /** - * @default the name of the process - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - processName: string; - - /** - * @default ability start time - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - startTime: number; - - /** - * @default Enumerates state of the ability state info - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - abilityState: abilityManager.AbilityState; +/* + * 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 { ElementName } from '../bundle/elementName'; +import abilityManager from '../@ohos.application.abilityManager'; + +/** + * The class of an ability running information. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + * @permission N/A + */ +export interface AbilityRunningInfo { + /** + * @default ability element name + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + ability: ElementName; + + /** + * @default process id + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + pid: number; + + /** + * @default user id + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + uid: number; + + /** + * @default the name of the process + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + processName: string; + + /** + * @default ability start time + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + startTime: number; + + /** + * @default Enumerates state of the ability state info + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + abilityState: abilityManager.AbilityState; } \ No newline at end of file diff --git a/api/application/EventHub.d.ts b/api/application/EventHub.d.ts index cbc9cbdc8b52946d1a78035c0be3fbac91e74a67..7fe3d203caeeacd2d0139d830ecb382e61b02538 100644 --- a/api/application/EventHub.d.ts +++ b/api/application/EventHub.d.ts @@ -1,60 +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 +/* + * 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/application/ExtensionRunningInfo.d.ts b/api/application/ExtensionRunningInfo.d.ts index 5021e879d1687f5e469be7f2b760711c39a01c91..32abe9c2647daf5c7c6f5f7f8ce0ddd4515a4cbc 100644 --- a/api/application/ExtensionRunningInfo.d.ts +++ b/api/application/ExtensionRunningInfo.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 { ElementName } from '../bundle/elementName'; -import bundle from '../@ohos.bundle'; - -/** - * The class of an extension running information. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - * @permission N/A - */ -export interface ExtensionRunningInfo { - /** - * @default Indicates the extension of the extension info - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - extension: ElementName; - - /** - * @default process id - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - pid: number; - - /** - * @default user id - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - uid: number; - - /** - * @default the name of the process - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - processName: string; - - /** - * @default ability start time - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - startTime: number; - - /** - * @default All package names under the current process - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - clientPackage: Array; - - /** - * @default Enumerates types of the entension info - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - */ - type: bundle.ExtensionAbilityType; +/* + * 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 { ElementName } from '../bundle/elementName'; +import bundle from '../@ohos.bundle'; + +/** + * The class of an extension running information. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + * @permission N/A + */ +export interface ExtensionRunningInfo { + /** + * @default Indicates the extension of the extension info + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + extension: ElementName; + + /** + * @default process id + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + pid: number; + + /** + * @default user id + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + uid: number; + + /** + * @default the name of the process + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + processName: string; + + /** + * @default ability start time + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + startTime: number; + + /** + * @default All package names under the current process + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + clientPackage: Array; + + /** + * @default Enumerates types of the entension info + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + */ + type: bundle.ExtensionAbilityType; } \ No newline at end of file diff --git a/api/application/MissionCallbacks.d.ts b/api/application/MissionCallbacks.d.ts new file mode 100755 index 0000000000000000000000000000000000000000..02a4962069e7e2da8fd8658290783495f190b774 --- /dev/null +++ b/api/application/MissionCallbacks.d.ts @@ -0,0 +1,54 @@ +/* + * 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. + */ + +/** + * MissionCallback registered by app. + * + * @name MissionCallback + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @permission ohos.permission.MANAGE_MISSIONS + * @systemapi hide for inner use. + */ + export interface MissionCallback { + /** + * Called by system when mission changed. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param deviceId Indicates the deviceId mission changed. + */ + notifyMissionsChanged(deviceId: string): void; + + /** + * Called by system when snapshop changed. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param deviceId Indicates the deviceId mission changed. + * @param mission Indicates the id of destroyed mission. + */ + notifySnapshot(deviceId: string, mission: number): void; + + /** + * Called by system when network disconnect. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param deviceId Indicates the deviceId mission changed. + * @param state Indicates the state of network + */ + notifyNetDisconnect(deviceId: string, state: number): void; +} \ No newline at end of file diff --git a/api/application/MissionDeviceInfo.d.ts b/api/application/MissionDeviceInfo.d.ts new file mode 100755 index 0000000000000000000000000000000000000000..911a7455b4c8bf95fa531ce61a0a5e6f8ced3c7b --- /dev/null +++ b/api/application/MissionDeviceInfo.d.ts @@ -0,0 +1,32 @@ +/* + * 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. + */ + +/** + * Parameters corresponding to mission. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @permission ohos.permission.MANAGE_MISSIONS + * @systemapi hide for inner use. + */ + export interface MissionDeviceInfo { + /** + * Indicates the deviceId to start sync. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + deviceId: string; + } \ No newline at end of file diff --git a/api/application/MissionListener.d.ts b/api/application/MissionListener.d.ts index b7416ce23e1e9c2b874c0713367e72ae41592a70..07c409538aaf7d0e4c81180ffb657839cbafbd78 100644 --- a/api/application/MissionListener.d.ts +++ b/api/application/MissionListener.d.ts @@ -1,78 +1,78 @@ -/* - * 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 image from "../@ohos.multimedia.image"; - -/** - * MissionListener registered by app. - * - * @name MissionListener - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @permission N/A - * @systemapi hide for inner use. - */ - export interface MissionListener { - /** - * Called by system when mission created. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @param mission Indicates the id of created mission. - * @return - - */ - onMissionCreated(mission: number): void; - - /** - * Called by system when mission destroyed. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @param mission Indicates the id of destroyed mission. - * @return - - */ - onMissionDestroyed(mission: number): void; - - /** - * Called by system when mission shapshot changed. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @param mission Indicates the id of the mission which the snapshot changes - * @return - - */ - onMissionSnapshotChanged(mission: number): void; - - /** - * Called by system when mission moved to fornt. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @param mission Indicates the id of the mission being moved to the foreground. - * @return - - */ - onMissionMovedToFront(mission: number): void; - - /** - * Called by system when mission icon has changed. - * - * @since 9 - * @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 - - */ - onMissionIconUpdated(mission: number, icon: image.PixelMap): void; +/* + * 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 image from "../@ohos.multimedia.image"; + +/** + * MissionListener registered by app. + * + * @name MissionListener + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @permission N/A + * @systemapi hide for inner use. + */ + export interface MissionListener { + /** + * Called by system when mission created. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param mission Indicates the id of created mission. + * @return - + */ + onMissionCreated(mission: number): void; + + /** + * Called by system when mission destroyed. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param mission Indicates the id of destroyed mission. + * @return - + */ + onMissionDestroyed(mission: number): void; + + /** + * Called by system when mission shapshot changed. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param mission Indicates the id of the mission which the snapshot changes + * @return - + */ + onMissionSnapshotChanged(mission: number): void; + + /** + * Called by system when mission moved to fornt. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param mission Indicates the id of the mission being moved to the foreground. + * @return - + */ + onMissionMovedToFront(mission: number): void; + + /** + * Called by system when mission icon has changed. + * + * @since 9 + * @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 - + */ + onMissionIconUpdated(mission: number, icon: image.PixelMap): void; } \ No newline at end of file diff --git a/api/application/MissionParameter.d.ts b/api/application/MissionParameter.d.ts new file mode 100755 index 0000000000000000000000000000000000000000..e1b67f209e1602d710d58b85cb3b78f9c297bd18 --- /dev/null +++ b/api/application/MissionParameter.d.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +/** + * Parameters corresponding to mission. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @permission ohos.permission.MANAGE_MISSIONS + * @systemapi hide for inner use. + */ +export interface MissionParameter { + /** + * Indicates the deviceId to start sync. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + deviceId: string; + + /** + * If needed to fix the versions confilct. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + fixConflict: boolean; + + /** + * Tag used to be specified. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + tag: number; +} \ No newline at end of file diff --git a/api/application/PermissionRequestResult.d.ts b/api/application/PermissionRequestResult.d.ts index e99911584718ffa2abc7fcbbd36fd75b4d996321..a3d8d6ae04485a4c11d370caa716383f6a63f38e 100755 --- a/api/application/PermissionRequestResult.d.ts +++ b/api/application/PermissionRequestResult.d.ts @@ -1,43 +1,43 @@ -/* - * 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 result of requestPermissionsFromUser with asynchronous callback. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A - * @StageModelOnly - */ -export default class PermissionRequestResult { - /** - * The permissions passed in by the user. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - */ - permissions: Array; - - /** - * The results for the corresponding request permissions. The value 0 indicates that a - * permission is granted, and the value -1 indicates not. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly - */ - authResults: Array; +/* + * 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 result of requestPermissionsFromUser with asynchronous callback. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + * @StageModelOnly + */ +export default class PermissionRequestResult { + /** + * The permissions passed in by the user. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + permissions: Array; + + /** + * The results for the corresponding request permissions. The value 0 indicates that a + * permission is granted, and the value -1 indicates not. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + authResults: Array; } \ No newline at end of file diff --git a/api/application/ProcessRunningInfo.d.ts b/api/application/ProcessRunningInfo.d.ts index 2d489c1b14a5a918e7ea037658adf3d0ce9915b5..3e1e68917964413180805909c68a715989133b51 100644 --- a/api/application/ProcessRunningInfo.d.ts +++ b/api/application/ProcessRunningInfo.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. - */ - -/** - * The class of an process running information. - * - * @deprecated since 9 - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @permission N/A - */ -/** - * The class of an process running information. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A - */ -export interface ProcessRunningInfo { - /** - * @default process id - * @deprecated since 9 - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - */ - /** - * @default process id - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - */ - pid: number; - - /** - * @default user id - * @deprecated since 9 - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - */ - /** - * @default user id - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - */ - uid: number; - - /** - * @default the name of the process - * @deprecated since 9 - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - */ - /** - * @default the name of the process - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - */ - processName: string; - - /** - * @default an array of the bundleNames running in the process - * @deprecated since 9 - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - */ - /** - * @default an array of the bundleNames running in the process - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - */ - bundleNames: Array; +/* + * 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 class of an process running information. + * + * @deprecated since 9 + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @permission N/A + */ +/** + * The class of an process running information. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + */ +export interface ProcessRunningInfo { + /** + * @default process id + * @deprecated since 9 + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + /** + * @default process id + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + pid: number; + + /** + * @default user id + * @deprecated since 9 + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + /** + * @default user id + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + uid: number; + + /** + * @default the name of the process + * @deprecated since 9 + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + /** + * @default the name of the process + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + processName: string; + + /** + * @default an array of the bundleNames running in the process + * @deprecated since 9 + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + /** + * @default an array of the bundleNames running in the process + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + bundleNames: Array; } \ No newline at end of file diff --git a/api/bundle/PermissionDef.d.ts b/api/bundle/PermissionDef.d.ts index f47217e5475d5ccfb20e548954742dd81a9b9b36..6be050d5d9c4f317090f05de501fd41b9ac49346 100644 --- a/api/bundle/PermissionDef.d.ts +++ b/api/bundle/PermissionDef.d.ts @@ -1,51 +1,51 @@ -/* - * 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 defined permission details in file config.json - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * @systemapi - */ - export interface PermissionDef { - /** - * @default Indicates the name of this permission - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - permissionName: string; - - /** - * @default Indicates the grant mode of this permission - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - grantMode: number; - - /** - * @default Indicates the labelId of this permission - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - labelId: number; - - /** - * @default Indicates the descriptionId of this permission - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - descriptionId: number; -} +/* + * 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 defined permission details in file config.json + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + * @systemapi + */ + export interface PermissionDef { + /** + * @default Indicates the name of this permission + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + permissionName: string; + + /** + * @default Indicates the grant mode of this permission + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + grantMode: number; + + /** + * @default Indicates the labelId of this permission + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + labelId: number; + + /** + * @default Indicates the descriptionId of this permission + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + descriptionId: number; +} diff --git a/api/bundle/abilityInfo.d.ts b/api/bundle/abilityInfo.d.ts index 7812efd17260ec668699aa83b7b74a72ff26692f..b1ae1d907f5d8290801f0f1eef179f6ff5ad5a63 100644 --- a/api/bundle/abilityInfo.d.ts +++ b/api/bundle/abilityInfo.d.ts @@ -1,281 +1,281 @@ -/* - * 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 { CustomizeData } from './customizeData' -import { Metadata } from './metadata' -import bundle from './../@ohos.bundle'; - -/** - * @name Obtains configuration information about an ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - */ -export interface AbilityInfo { - /** - * @default Indicates the name of the bundle containing the ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly bundleName: string; - - /** - * @default Ability simplified class name - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly name: string; - - /** - * @default Indicates the label of the ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly label: string; - - /** - * @default Describes the ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly description: string; - - /** - * @default Indicates the icon of the ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly icon: string; - - /** - * @default Indicates the label id of the ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly labelId: number; - - /** - * @default Indicates the description id of the ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly descriptionId: number; - - /** - * @default Indicates the icon id of the ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly iconId: number; - - /** - * @default Indicates the name of the .hap package to which the capability belongs - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly moduleName: string; - - /** - * @default Process of ability, if user do not set it ,the value equal application process - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly process: string; - - /** - * @default Info about which ability is this nick point to - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @FAModelOnly - */ - readonly targetAbility: string; - - /** - * @default Indicates the background service addressing a specific usage scenario - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @FAModelOnly - */ - readonly backgroundModes: number; - - /** - * @default Indicates whether an ability can be called by other abilities - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly isVisible: boolean; - - /** - * @default Indicates whether the ability provides the embedded card capability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @FAModelOnly - */ - readonly formEnabled: boolean; - - /** - * @default Enumerates types of templates that can be used by an ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @FAModelOnly - */ - readonly type: bundle.AbilityType; - - /** - * @default Enumerates the subType of templates used by an ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @FAModelOnly - */ - readonly subType: bundle.AbilitySubType; - - /** - * @default Enumerates ability display orientations - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly orientation: bundle.DisplayOrientation; - - /** - * @default Enumerates ability launch modes - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly launchMode: bundle.LaunchMode; - - /** - * @default The permissions that others need to launch this ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly permissions: Array; - - /** - * @default The device types that this ability can run on - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly deviceTypes: Array; - - /** - * @default The device capability that this ability needs - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly deviceCapabilities: Array; - - /** - * @default Indicates the permission required for reading ability data - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @FAModelOnly - */ - readonly readPermission: string; - - /** - * @default Indicates the permission required for writing data to the ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @FAModelOnly - */ - readonly writePermission: string; - - /** - * @default Obtains configuration information about an application - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly applicationInfo: ApplicationInfo; - - /** - * @default Uri of ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @FAModelOnly - */ - readonly uri: string; - - /** - * @default Indicates the metadata of ability - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - 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; -} +/* + * 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 { CustomizeData } from './customizeData' +import { Metadata } from './metadata' +import bundle from './../@ohos.bundle'; + +/** + * @name Obtains configuration information about an ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + */ +export interface AbilityInfo { + /** + * @default Indicates the name of the bundle containing the ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly bundleName: string; + + /** + * @default Ability simplified class name + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly name: string; + + /** + * @default Indicates the label of the ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly label: string; + + /** + * @default Describes the ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly description: string; + + /** + * @default Indicates the icon of the ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly icon: string; + + /** + * @default Indicates the label id of the ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly labelId: number; + + /** + * @default Indicates the description id of the ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly descriptionId: number; + + /** + * @default Indicates the icon id of the ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly iconId: number; + + /** + * @default Indicates the name of the .hap package to which the capability belongs + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly moduleName: string; + + /** + * @default Process of ability, if user do not set it ,the value equal application process + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly process: string; + + /** + * @default Info about which ability is this nick point to + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + */ + readonly targetAbility: string; + + /** + * @default Indicates the background service addressing a specific usage scenario + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + */ + readonly backgroundModes: number; + + /** + * @default Indicates whether an ability can be called by other abilities + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly isVisible: boolean; + + /** + * @default Indicates whether the ability provides the embedded card capability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + */ + readonly formEnabled: boolean; + + /** + * @default Enumerates types of templates that can be used by an ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + */ + readonly type: bundle.AbilityType; + + /** + * @default Enumerates the subType of templates used by an ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + */ + readonly subType: bundle.AbilitySubType; + + /** + * @default Enumerates ability display orientations + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly orientation: bundle.DisplayOrientation; + + /** + * @default Enumerates ability launch modes + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly launchMode: bundle.LaunchMode; + + /** + * @default The permissions that others need to launch this ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly permissions: Array; + + /** + * @default The device types that this ability can run on + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly deviceTypes: Array; + + /** + * @default The device capability that this ability needs + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly deviceCapabilities: Array; + + /** + * @default Indicates the permission required for reading ability data + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + */ + readonly readPermission: string; + + /** + * @default Indicates the permission required for writing data to the ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + */ + readonly writePermission: string; + + /** + * @default Obtains configuration information about an application + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly applicationInfo: ApplicationInfo; + + /** + * @default Uri of ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + */ + readonly uri: string; + + /** + * @default Indicates the metadata of ability + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + 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/bundleInfo.d.ts b/api/bundle/bundleInfo.d.ts index 2f71c27b38a6da205c6b5949655178c3e42383a6..4da8310f4300f390e4faf00594cd3c43730c4cca 100644 --- a/api/bundle/bundleInfo.d.ts +++ b/api/bundle/bundleInfo.d.ts @@ -1,259 +1,259 @@ -/* - * 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 { ApplicationInfo } from './applicationInfo'; -import { ExtensionAbilityInfo } from './extensionAbilityInfo'; -import { HapModuleInfo } from './hapModuleInfo'; - -/** - * @name The scene which is used - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * - */ -export interface UsedScene { - /** - * @default Indicates the abilities that need the permission - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - abilities: Array; - - /** - * @default Indicates the time when the permission is used - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - when: string; -} - -/** - * @name Indicates the required permissions details defined in file config.json - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * - */ -export interface ReqPermissionDetail { - /** - * @default Indicates the name of this required permissions - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - name: string; - - /** - * @default Indicates the reason of this required permissions - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - 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 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - usedScene: UsedScene; -} - -/** - * @name Obtains configuration information about a bundle - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * - */ -export interface BundleInfo { - /** - * @default Indicates the name of this bundle - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly name: string; - - /** - * @default Indicates the name of this original bundle - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly type: string; - - /** - * @default 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 - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly appId: string; - - /** - * @default Indicates the UID of the application to which this bundle belongs - * The UID uniquely identifies an application. It is determined by the process and user IDs of the application - * After an application is installed, its UID remains unchanged unless it is uninstalled and then reinstalled - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly uid: number; - - /** - * @default Indicates the hap install time - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly installTime: number; - - /** - * @default Indicates the hap update time - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly updateTime: number; - - /** - * @default Obtains configuration information about an application - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly appInfo: ApplicationInfo; - - /** - * @default Obtains configuration information about an ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly abilityInfos: Array; - - /** - * @default Indicates the required permissions name defined in file config.json - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly reqPermissions: Array; - - /** - * @default Indicates the required permissions details defined in file config.json - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly reqPermissionDetails: Array; - - /** - * @default Describes the bundle vendor - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly vendor: string; - - /** - * @default Indicates the version number of the bundle - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly versionCode: number; - - /** - * @default Indicates the text description of the bundle version - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly versionName: string; - - /** - * @default Indicates the compatible version number of the bundle - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly compatibleVersion: number; - - /** - * @default Indicates the target version number of the bundle - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly targetVersion: number; - - /** - * @default Indicates is compress native libs - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly isCompressNativeLibs: boolean; - - /** - * @default Obtains configuration information about an module - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly hapModuleInfos: Array; - - /** - * @default Indicates entry module name - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly entryModuleName: string; - - /** - * @default Indicates the cpuAbi information of this bundle. - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly cpuAbi: string; - - /** - * @default Indicates is silent installation - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly isSilentInstallation: string; - - /** - * @default Indicates the earliest historical version compatible with the bundle - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly minCompatibleVersionCode: number; - - /** - * @default Indicates whether free installation of the entry is supported - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly entryInstallationFree: boolean; - - /** - * @default Indicates the grant status of required permissions - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly reqPermissionStates: Array; - - /** - * @default Obtains configuration information about an ability - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly extensionAbilityInfo: Array; -} +/* + * 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 { ApplicationInfo } from './applicationInfo'; +import { ExtensionAbilityInfo } from './extensionAbilityInfo'; +import { HapModuleInfo } from './hapModuleInfo'; + +/** + * @name The scene which is used + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + * + */ +export interface UsedScene { + /** + * @default Indicates the abilities that need the permission + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + abilities: Array; + + /** + * @default Indicates the time when the permission is used + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + when: string; +} + +/** + * @name Indicates the required permissions details defined in file config.json + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + * + */ +export interface ReqPermissionDetail { + /** + * @default Indicates the name of this required permissions + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + name: string; + + /** + * @default Indicates the reason of this required permissions + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + 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 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + usedScene: UsedScene; +} + +/** + * @name Obtains configuration information about a bundle + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + * + */ +export interface BundleInfo { + /** + * @default Indicates the name of this bundle + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly name: string; + + /** + * @default Indicates the name of this original bundle + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly type: string; + + /** + * @default 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 + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly appId: string; + + /** + * @default Indicates the UID of the application to which this bundle belongs + * The UID uniquely identifies an application. It is determined by the process and user IDs of the application + * After an application is installed, its UID remains unchanged unless it is uninstalled and then reinstalled + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly uid: number; + + /** + * @default Indicates the hap install time + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly installTime: number; + + /** + * @default Indicates the hap update time + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly updateTime: number; + + /** + * @default Obtains configuration information about an application + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly appInfo: ApplicationInfo; + + /** + * @default Obtains configuration information about an ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly abilityInfos: Array; + + /** + * @default Indicates the required permissions name defined in file config.json + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly reqPermissions: Array; + + /** + * @default Indicates the required permissions details defined in file config.json + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly reqPermissionDetails: Array; + + /** + * @default Describes the bundle vendor + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly vendor: string; + + /** + * @default Indicates the version number of the bundle + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly versionCode: number; + + /** + * @default Indicates the text description of the bundle version + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly versionName: string; + + /** + * @default Indicates the compatible version number of the bundle + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly compatibleVersion: number; + + /** + * @default Indicates the target version number of the bundle + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly targetVersion: number; + + /** + * @default Indicates is compress native libs + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly isCompressNativeLibs: boolean; + + /** + * @default Obtains configuration information about an module + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly hapModuleInfos: Array; + + /** + * @default Indicates entry module name + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly entryModuleName: string; + + /** + * @default Indicates the cpuAbi information of this bundle. + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly cpuAbi: string; + + /** + * @default Indicates is silent installation + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly isSilentInstallation: string; + + /** + * @default Indicates the earliest historical version compatible with the bundle + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly minCompatibleVersionCode: number; + + /** + * @default Indicates whether free installation of the entry is supported + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly entryInstallationFree: boolean; + + /** + * @default Indicates the grant status of required permissions + * @since 8 + * @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/customizeData.d.ts b/api/bundle/customizeData.d.ts index 62cb31ea946c3829777e3db64d95dc3b0b98bb29..4427daf06140214d97ac34ea92efb612e3812218 100644 --- a/api/bundle/customizeData.d.ts +++ b/api/bundle/customizeData.d.ts @@ -1,44 +1,44 @@ -/* - * 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 custom metadata - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * - */ - export interface CustomizeData { - /** - * @default Indicates the custom metadata name - * @since 7 - * @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 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - extra: string; +/* + * 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 custom metadata + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + * + */ + export interface CustomizeData { + /** + * @default Indicates the custom metadata name + * @since 7 + * @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 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + extra: string; } \ No newline at end of file diff --git a/api/bundle/elementName.d.ts b/api/bundle/elementName.d.ts index 92f4628f8c0628e5cceb1d1079785301b9d25822..3eeff9218e709706e4821e0a0b66f6186e924396 100644 --- a/api/bundle/elementName.d.ts +++ b/api/bundle/elementName.d.ts @@ -1,80 +1,80 @@ -/* - * 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. - */ - -/** - * 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. - * @name Contains basic Ability information, which uniquely identifies an ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * - * @permission N/A - */ - export interface ElementName { - /** - * device id - * @default - - * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - deviceId?: string; - - /** - * bundle name - * @default - - * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - bundleName: string; - - /** - * ability name - * @default ability class name. - * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - abilityName: string; - - /** - * uri - * @default - - * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - uri?: string; - - /** - * shortName - * @default - - * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - shortName?: string; - - /** - * module name - * @default - - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - moduleName?: string; -} +/* + * 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. + */ + +/** + * 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. + * @name Contains basic Ability information, which uniquely identifies an ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * + * @permission N/A + */ + export interface ElementName { + /** + * device id + * @default - + * + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + deviceId?: string; + + /** + * bundle name + * @default - + * + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + bundleName: string; + + /** + * ability name + * @default ability class name. + * + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + abilityName: string; + + /** + * uri + * @default - + * + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + uri?: string; + + /** + * shortName + * @default - + * + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + shortName?: string; + + /** + * module name + * @default - + * + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + moduleName?: string; +} diff --git a/api/bundle/hapModuleInfo.d.ts b/api/bundle/hapModuleInfo.d.ts index 26c930161cefc266814943c98fb2c0883db40f27..5ed5be922e699bba39e878bdec513cbdfba1df67 100644 --- a/api/bundle/hapModuleInfo.d.ts +++ b/api/bundle/hapModuleInfo.d.ts @@ -1,145 +1,145 @@ -/* - * 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' - -/** - * @name Obtains configuration information about an module. - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * - */ -export interface HapModuleInfo { - /** - * @default Indicates the name of this hapmodule - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly name: string; - /** - * @default Describes the hapmodule - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly description: string; - /** - * @default Indicates the description of this hapmodule - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly descriptionId: number; - /** - * @default Indicates the icon of this hapmodule - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly icon: string; - /** - * @default Indicates the label of this hapmodule - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly label: string; - /** - * @default Indicates the label id of this hapmodule - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly labelId: number; - /** - * @default Indicates the icon id of this hapmodule - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly iconId: number; - /** - * @default Indicates the background img of this hapmodule - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly backgroundImg: string; - /** - * @default Indicates the supported modes of this hapmodule - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly supportedModes: number; - /** - * @default Indicates the req capabilities of this hapmodule - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly reqCapabilities: Array; - /** - * @default The device types that this hapmodule can run on - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly deviceTypes: Array; - /** - * @default Obtains configuration information about ability - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly abilityInfo: Array; - /** - * @default Indicates the name of the .hap package to which the capability belongs - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly moduleName: string; - /** - * @default Indicates the main ability name of this hapmodule - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly mainAbilityName: string; - /** - * @default Indicates whether free installation of the hapmodule is supported - * @since 7 - * @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; +/* + * 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' + +/** + * @name Obtains configuration information about an module. + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + * + */ +export interface HapModuleInfo { + /** + * @default Indicates the name of this hapmodule + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly name: string; + /** + * @default Describes the hapmodule + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly description: string; + /** + * @default Indicates the description of this hapmodule + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly descriptionId: number; + /** + * @default Indicates the icon of this hapmodule + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly icon: string; + /** + * @default Indicates the label of this hapmodule + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly label: string; + /** + * @default Indicates the label id of this hapmodule + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly labelId: number; + /** + * @default Indicates the icon id of this hapmodule + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly iconId: number; + /** + * @default Indicates the background img of this hapmodule + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly backgroundImg: string; + /** + * @default Indicates the supported modes of this hapmodule + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly supportedModes: number; + /** + * @default Indicates the req capabilities of this hapmodule + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly reqCapabilities: Array; + /** + * @default The device types that this hapmodule can run on + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly deviceTypes: Array; + /** + * @default Obtains configuration information about ability + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly abilityInfo: Array; + /** + * @default Indicates the name of the .hap package to which the capability belongs + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly moduleName: string; + /** + * @default Indicates the main ability name of this hapmodule + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly mainAbilityName: string; + /** + * @default Indicates whether free installation of the hapmodule is supported + * @since 7 + * @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/moduleInfo.d.ts b/api/bundle/moduleInfo.d.ts index 434eacc5dc8f942ccc6ab2690ec46ad1e1a18c38..f961a10b9d6cabbadef869709aaa1a848f860e43 100644 --- a/api/bundle/moduleInfo.d.ts +++ b/api/bundle/moduleInfo.d.ts @@ -1,43 +1,43 @@ -/* - * 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 Stores module information about an application. - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * - */ - export interface ModuleInfo { - /** - * The module name. - * - * @default Indicates the name of the .hap package to which the capability belongs - * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly moduleName: string; - - /** - * The module source path. - * - * @default Indicates the module source dir of this module - * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly moduleSourceDir: string; +/* + * 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 Stores module information about an application. + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + * + */ + export interface ModuleInfo { + /** + * The module name. + * + * @default Indicates the name of the .hap package to which the capability belongs + * + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly moduleName: string; + + /** + * The module source path. + * + * @default Indicates the module source dir of this module + * + * @since 7 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly moduleSourceDir: string; } \ No newline at end of file diff --git a/api/common/full/dom.d.ts b/api/common/full/dom.d.ts index 39f358f314f49f9cdc76571f5c1a9f1ec20f26e5..2efda420093a152bc836c990eb5dfb3f87f05c96 100644 --- a/api/common/full/dom.d.ts +++ b/api/common/full/dom.d.ts @@ -1,29 +1,29 @@ -/* - * 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. - */ - -export { Element } from './viewmodel'; - -/** - * global dom - * @since 8 - */ -export declare class dom { - /** - * create a dynamic dom by tag, rturn element - * @param tag dom tag - * @since 8 - */ - static createElement(tag: string): Element -} +/* + * 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. + */ + +export { Element } from './viewmodel'; + +/** + * global dom + * @since 8 + */ +export declare class dom { + /** + * create a dynamic dom by tag, rturn element + * @param tag dom tag + * @since 8 + */ + static createElement(tag: string): Element +} diff --git a/api/common/full/featureability.d.ts b/api/common/full/featureability.d.ts index e37966a9938a1b2ed5e2c5f6a8496a747355bcb4..bc825a0587767dd67bf875f9b72092b023c18ad3 100644 --- a/api/common/full/featureability.d.ts +++ b/api/common/full/featureability.d.ts @@ -1,399 +1,399 @@ -/* - * 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. - */ - -/** - * @since 5 - * @deprecated since 8 - */ -export interface Result { - /** - * Result code. - * @since 5 - */ - code: number; - - /** - * Returned data. - * @since 5 - */ - data: object; -} - -/** - * @since 5 - * @systemapi - * @deprecated since 8 - */ -export interface SubscribeMessageResponse { - /** - * Peer device ID. - * @since 5 - */ - deviceId: string; - - /** - * Name of the bundle where the peer ability locates. The name is case sensitive. - * @since 5 - */ - bundleName: string; - - /** - * Peer ability name, which is case sensitive. - * @since 5 - */ - abilityName: string; - - /** - * Messages received from the device. - * @since 5 - */ - message: string; -} - -/** - * @since 5 - * @deprecated since 8 - */ -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. - * @since 5 - */ - bundleName: string; - - /** - * Ability name, which is case sensitive and must be the same as that on the AA side. - * @since 5 - */ - abilityName: string; - - /** - * Ability operation code, which defines the service function of an AA and must be consistent with the AA side. - * @since 5 - */ - messageCode: number; - - /** - * Ability type. Different types of abilities have different implementation on the AA side. - * 0: Ability, which has an independent lifecycle. The FA starts and requests an AA through an RPC. Such type of abilities are used to provide basic services for multiple FAs to call or are used when the abilities should run in the background. - * 1: Internal ability, which shares the same process with the FA and communicates with it by calling internal functions. Such type of abilities are used in scenarios that require low response latency and cannot be called by other FAs. - * @since 5 - */ - abilityType: number; - - /** - * Data sent to the ability. The data to carry differs depending on the service to be processed and its field name must be consistent with the AA side. - * @since 5 - */ - data?: object; - - /** - * Whether the request is synchronous or asynchronous. The synchronous mode is used by default. Currently, the asynchronous mode is available only for internal abilities. - * 0: Synchronous mode (default value) - * 1: Asynchronous mode - * @since 5 - */ - syncOption?: number; -} - -/** - * @since 5 - * @deprecated since 8 - */ -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. - * @since 5 - */ - bundleName: string; - - /** - * Ability name, which is case sensitive and must be the same as that on the AA side. - * @since 5 - */ - abilityName: string; - - /** - * Ability operation code, which defines the service function of an AA and must be consistent with the AA side. - * @since 5 - */ - messageCode: number; - - /** - * Ability type. Different types of abilities have different implementation on the AA side. - * 0: Ability, which has an independent lifecycle. The FA starts and requests an AA through an RPC. Such type of abilities are used to provide basic services for multiple FAs to call or are used when the abilities should run in the background. - * 1: Internal ability, which shares the same process with the FA and communicates with it by calling internal functions. Such type of abilities are used in scenarios that require low response latency and cannot be called by other FAs. - * @since 5 - */ - abilityType: number; - - /** - * Whether the request is synchronous or asynchronous. The synchronous mode is used by default. Currently, the asynchronous mode is available only for internal abilities. - * 0: Synchronous mode (default value) - * 1: Asynchronous mode - * @since 5 - */ - syncOption?: number; -} - -/** - * @since 5 - * @systemapi - * @deprecated since 8 - */ -export interface SendMessageOptions { - /** - * Destination device ID. - * @since 5 - */ - deviceId: string; - - /** - * Name of the destination bundle where the ability locates. The name is case sensitive. - * @since 5 - */ - bundleName: string; - - /** - * Destination ability name, which is case sensitive. - * @since 5 - */ - abilityName: string; - - /** - * Messages sent to the destination device. - * A maximum of 1 KB of data can be transmitted at a time. - * If more than 1 KB of data needs to be transmitted, split the messages into multiple parts to transmit. - * @since 5 - */ - message?: string; - - /** - * Called when the messages are sent successfully. - * @since 5 - */ - success?: () => void; - - /** - * Called when the messages fail to be sent. - * @since 5 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 5 - */ - complete?: () => void; -} - -/** - * @since 5 - * @systemapi - * @deprecated since 8 - */ -export interface SubscribeMessageOptions { - /** - * Called when the messages are sent successfully. - * @since 5 - */ - success?: (data: SubscribeMessageResponse) => void; - - /** - * Called when the messages fail to be sent. - * @since 5 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @since 5 - * @deprecated since 8 - */ -export interface RequestParams { - /** - * The name of the bundle to start. It should be used with abilityname and case sensitive. - * @since 5 - */ - bundleName?: string; - - /** - * Ability name, which is case sensitive. - * @since 5 - */ - abilityName?: string; - - /** - * The list of entities to which the FA to be called. If it is not filled in, all entity lists will be found by default. It should be used with action. - * @since 5 - */ - entities?: Array; - - /** - * Without specifying the bundle name and ability name, you can start the application according to other properties with action. - * @since 5 - */ - action?: string; - - /** - * If more than one FA meets the conditions, the user can select the device from the popup. - * 0: Default. Select the FA to start from the local and remote devices. - * 1: start FA from the local device. - * @since 5 - */ - deviceType?: number; - - /** - * Data sent to the ability which need to be serializable. - * @since 5 - */ - data?: object; - - /** - * Configuration switch when start FA. - * @since 5 - */ - flag?: number; - - /** - * Specify the url of the page which the FA to be called. Use home page directly by default. - * @since 5 - */ - url?: string; -} - -/** - * @since 5 - * @deprecated since 8 - */ -export interface FinishWithResultParams { - /** - * Result code. - * @since 5 - */ - code: number; - - /** - * Returned data. - * @since 5 - */ - result: object; -} - -/** - * @since 5 - * @deprecated since 8 - */ -export declare class FeatureAbility { - /** - * Start a FA without callback result. - * @param request Indicates the request param. - * @returns A Promise object is returned, which contains the result of whether to call Ability's interface successfully. - * @since 5 - * @deprecated since 8 - */ - static startAbility(request: RequestParams): Promise; - - /** - * Start a FA with callback result. - * @param request Indicates the request param. - * @returns A Promise object is returned, which contains the result of the data FA returned. - * @since 5 - * @deprecated since 8 - */ - static startAbilityForResult(request: RequestParams): Promise; - - /** - * FA call the interface to destory 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 - * @deprecated since 8 - */ - 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. - * @since 5 - * @deprecated since 8 - */ - static getDeviceList(flag: number): Promise; - - /** - - * Calls 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 - * @deprecated since 8 - */ - static callAbility(param: CallAbilityParam): Promise; - - /** - * Start FA migration. - * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. - * @since 5 - * @deprecated since 8 - */ - static continueAbility(): Promise; - - /** - * Subscribes 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. - * @since 5 - * @deprecated since 8 - */ - static subscribeAbilityEvent(param: SubscribeAbilityEventParam, func: Function): Promise; - - /** - * Unsubscribes 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 - * @deprecated since 8 - */ - static unsubscribeAbilityEvent(param: SubscribeAbilityEventParam): Promise; - - /** - * Sends messages to the destination device. - * @param options Options. - * @since 5 - * @systemapi - * @deprecated since 8 - */ - static sendMsg(options: SendMessageOptions): void; - - /** - * Listens for messages sent from other devices. - * @param options Options. - * @since 5 - * @systemapi - * @deprecated since 8 - */ - static subscribeMsg(options: SubscribeMessageOptions): void; - - /** - * Cancels the listening for messages sent from other devices. - * @since 5 - * @systemapi - * @deprecated since 8 - */ - static unsubscribeMsg(): void; -} +/* + * 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. + */ + +/** + * @since 5 + * @deprecated since 8 + */ +export interface Result { + /** + * Result code. + * @since 5 + */ + code: number; + + /** + * Returned data. + * @since 5 + */ + data: object; +} + +/** + * @since 5 + * @systemapi + * @deprecated since 8 + */ +export interface SubscribeMessageResponse { + /** + * Peer device ID. + * @since 5 + */ + deviceId: string; + + /** + * Name of the bundle where the peer ability locates. The name is case sensitive. + * @since 5 + */ + bundleName: string; + + /** + * Peer ability name, which is case sensitive. + * @since 5 + */ + abilityName: string; + + /** + * Messages received from the device. + * @since 5 + */ + message: string; +} + +/** + * @since 5 + * @deprecated since 8 + */ +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. + * @since 5 + */ + bundleName: string; + + /** + * Ability name, which is case sensitive and must be the same as that on the AA side. + * @since 5 + */ + abilityName: string; + + /** + * Ability operation code, which defines the service function of an AA and must be consistent with the AA side. + * @since 5 + */ + messageCode: number; + + /** + * Ability type. Different types of abilities have different implementation on the AA side. + * 0: Ability, which has an independent lifecycle. The FA starts and requests an AA through an RPC. Such type of abilities are used to provide basic services for multiple FAs to call or are used when the abilities should run in the background. + * 1: Internal ability, which shares the same process with the FA and communicates with it by calling internal functions. Such type of abilities are used in scenarios that require low response latency and cannot be called by other FAs. + * @since 5 + */ + abilityType: number; + + /** + * Data sent to the ability. The data to carry differs depending on the service to be processed and its field name must be consistent with the AA side. + * @since 5 + */ + data?: object; + + /** + * Whether the request is synchronous or asynchronous. The synchronous mode is used by default. Currently, the asynchronous mode is available only for internal abilities. + * 0: Synchronous mode (default value) + * 1: Asynchronous mode + * @since 5 + */ + syncOption?: number; +} + +/** + * @since 5 + * @deprecated since 8 + */ +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. + * @since 5 + */ + bundleName: string; + + /** + * Ability name, which is case sensitive and must be the same as that on the AA side. + * @since 5 + */ + abilityName: string; + + /** + * Ability operation code, which defines the service function of an AA and must be consistent with the AA side. + * @since 5 + */ + messageCode: number; + + /** + * Ability type. Different types of abilities have different implementation on the AA side. + * 0: Ability, which has an independent lifecycle. The FA starts and requests an AA through an RPC. Such type of abilities are used to provide basic services for multiple FAs to call or are used when the abilities should run in the background. + * 1: Internal ability, which shares the same process with the FA and communicates with it by calling internal functions. Such type of abilities are used in scenarios that require low response latency and cannot be called by other FAs. + * @since 5 + */ + abilityType: number; + + /** + * Whether the request is synchronous or asynchronous. The synchronous mode is used by default. Currently, the asynchronous mode is available only for internal abilities. + * 0: Synchronous mode (default value) + * 1: Asynchronous mode + * @since 5 + */ + syncOption?: number; +} + +/** + * @since 5 + * @systemapi + * @deprecated since 8 + */ +export interface SendMessageOptions { + /** + * Destination device ID. + * @since 5 + */ + deviceId: string; + + /** + * Name of the destination bundle where the ability locates. The name is case sensitive. + * @since 5 + */ + bundleName: string; + + /** + * Destination ability name, which is case sensitive. + * @since 5 + */ + abilityName: string; + + /** + * Messages sent to the destination device. + * A maximum of 1 KB of data can be transmitted at a time. + * If more than 1 KB of data needs to be transmitted, split the messages into multiple parts to transmit. + * @since 5 + */ + message?: string; + + /** + * Called when the messages are sent successfully. + * @since 5 + */ + success?: () => void; + + /** + * Called when the messages fail to be sent. + * @since 5 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 5 + */ + complete?: () => void; +} + +/** + * @since 5 + * @systemapi + * @deprecated since 8 + */ +export interface SubscribeMessageOptions { + /** + * Called when the messages are sent successfully. + * @since 5 + */ + success?: (data: SubscribeMessageResponse) => void; + + /** + * Called when the messages fail to be sent. + * @since 5 + */ + fail?: (data: string, code: number) => void; +} + +/** + * @since 5 + * @deprecated since 8 + */ +export interface RequestParams { + /** + * The name of the bundle to start. It should be used with abilityname and case sensitive. + * @since 5 + */ + bundleName?: string; + + /** + * Ability name, which is case sensitive. + * @since 5 + */ + abilityName?: string; + + /** + * The list of entities to which the FA to be called. If it is not filled in, all entity lists will be found by default. It should be used with action. + * @since 5 + */ + entities?: Array; + + /** + * Without specifying the bundle name and ability name, you can start the application according to other properties with action. + * @since 5 + */ + action?: string; + + /** + * If more than one FA meets the conditions, the user can select the device from the popup. + * 0: Default. Select the FA to start from the local and remote devices. + * 1: start FA from the local device. + * @since 5 + */ + deviceType?: number; + + /** + * Data sent to the ability which need to be serializable. + * @since 5 + */ + data?: object; + + /** + * Configuration switch when start FA. + * @since 5 + */ + flag?: number; + + /** + * Specify the url of the page which the FA to be called. Use home page directly by default. + * @since 5 + */ + url?: string; +} + +/** + * @since 5 + * @deprecated since 8 + */ +export interface FinishWithResultParams { + /** + * Result code. + * @since 5 + */ + code: number; + + /** + * Returned data. + * @since 5 + */ + result: object; +} + +/** + * @since 5 + * @deprecated since 8 + */ +export declare class FeatureAbility { + /** + * Start a FA without callback result. + * @param request Indicates the request param. + * @returns A Promise object is returned, which contains the result of whether to call Ability's interface successfully. + * @since 5 + * @deprecated since 8 + */ + static startAbility(request: RequestParams): Promise; + + /** + * Start a FA with callback result. + * @param request Indicates the request param. + * @returns A Promise object is returned, which contains the result of the data FA returned. + * @since 5 + * @deprecated since 8 + */ + static startAbilityForResult(request: RequestParams): Promise; + + /** + * FA call the interface to destory 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 + * @deprecated since 8 + */ + 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. + * @since 5 + * @deprecated since 8 + */ + static getDeviceList(flag: number): Promise; + + /** + + * Calls 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 + * @deprecated since 8 + */ + static callAbility(param: CallAbilityParam): Promise; + + /** + * Start FA migration. + * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. + * @since 5 + * @deprecated since 8 + */ + static continueAbility(): Promise; + + /** + * Subscribes 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. + * @since 5 + * @deprecated since 8 + */ + static subscribeAbilityEvent(param: SubscribeAbilityEventParam, func: Function): Promise; + + /** + * Unsubscribes 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 + * @deprecated since 8 + */ + static unsubscribeAbilityEvent(param: SubscribeAbilityEventParam): Promise; + + /** + * Sends messages to the destination device. + * @param options Options. + * @since 5 + * @systemapi + * @deprecated since 8 + */ + static sendMsg(options: SendMessageOptions): void; + + /** + * Listens for messages sent from other devices. + * @param options Options. + * @since 5 + * @systemapi + * @deprecated since 8 + */ + static subscribeMsg(options: SubscribeMessageOptions): void; + + /** + * Cancels the listening for messages sent from other devices. + * @since 5 + * @systemapi + * @deprecated since 8 + */ + static unsubscribeMsg(): void; +} diff --git a/api/common/lite/console.d.ts b/api/common/lite/console.d.ts index fa2c5cc33eeb529c6becdd7be5ce80fde5ec7e0c..2d8d27582dff6cf03f1d795cab47a1698e4ee124 100644 --- a/api/common/lite/console.d.ts +++ b/api/common/lite/console.d.ts @@ -1,46 +1,46 @@ -/* - * 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. - */ - -export declare class console { - /** - * Prints "debug" logs. - * @param message Text to print - */ - static debug(message: string): void; - - /** - * Prints "log" logs. - * @param message Text to print - */ - static log(message: string): void; - - /** - * Prints "info" logs. - * @param message Text to print - */ - static info(message: string): void; - - /** - * Prints "warn" logs. - * @param message Text to print - */ - static warn(message: string): void; - - /** - * Prints "error" logs. - * @param message Text to print - */ - static error(message: string): void; -} +/* + * 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. + */ + +export declare class console { + /** + * Prints "debug" logs. + * @param message Text to print + */ + static debug(message: string): void; + + /** + * Prints "log" logs. + * @param message Text to print + */ + static log(message: string): void; + + /** + * Prints "info" logs. + * @param message Text to print + */ + static info(message: string): void; + + /** + * Prints "warn" logs. + * @param message Text to print + */ + static warn(message: string): void; + + /** + * Prints "error" logs. + * @param message Text to print + */ + static error(message: string): void; +} diff --git a/api/common/lite/featureability.d.ts b/api/common/lite/featureability.d.ts index cbe4af87978db91de0a5d370abed6125749e58ac..014cbb7538d408c8d24df4e8bab19f4f62256651 100644 --- a/api/common/lite/featureability.d.ts +++ b/api/common/lite/featureability.d.ts @@ -1,147 +1,147 @@ -/* - * 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. - */ - -/** - * @since 5 - * @systemapi - * @deprecated since 8 - */ -export interface SubscribeMessageResponse { - /** - * Peer device ID. - * @since 5 - */ - deviceId: string; - - /** - * Name of the bundle where the peer ability locates. The name is case sensitive. - * @since 5 - */ - bundleName: string; - - /** - * Peer ability name, which is case sensitive. - * @since 5 - */ - abilityName: string; - - /** - * Messages received from the device. - * @since 5 - */ - message: string; -} - -/** - * @since 5 - * @systemapi - * @deprecated since 8 - */ -export interface SendMessageOptions { - /** - * Destination device ID. - * @since 5 - */ - deviceId: string; - - /** - * Name of the destination bundle where the ability locates. The name is case sensitive. - * @since 5 - */ - bundleName: string; - - /** - * Destination ability name, which is case sensitive. - * @since 5 - */ - abilityName: string; - - /** - * Messages sent to the destination device. - * A maximum of 1 KB of data can be transmitted at a time. - * If more than 1 KB of data needs to be transmitted, split the messages into multiple parts to transmit. - * @since 5 - */ - message?: string; - - /** - * Called when the messages are sent successfully. - * @since 5 - */ - success?: () => void; - - /** - * Called when the messages fail to be sent. - * @since 5 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 5 - */ - complete?: () => void; -} - -/** - * @since 5 - * @systemapi - * @deprecated since 8 - */ -export interface SubscribeMessageOptions { - /** - * Called when the messages are sent successfully. - * @since 5 - */ - success?: (data: SubscribeMessageResponse) => void; - - /** - * Called when the messages fail to be sent. - * @since 5 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @since 5 - * @deprecated since 8 - */ -export declare class FeatureAbility { - /** - * Sends messages to the destination device. - * @param options Options. - * @since 5 - * @systemapi - * @deprecated since 8 - */ - static sendMsg(options: SendMessageOptions): void; - - /** - * Listens for messages sent from other devices. - * @param options Options. - * @since 5 - * @systemapi - * @deprecated since 8 - */ - static subscribeMsg(options: SubscribeMessageOptions): void; - - /** - * Cancels the listening for messages sent from other devices. - * @since 5 - * @systemapi - * @deprecated since 8 - */ - static unsubscribeMsg(): void; -} +/* + * 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. + */ + +/** + * @since 5 + * @systemapi + * @deprecated since 8 + */ +export interface SubscribeMessageResponse { + /** + * Peer device ID. + * @since 5 + */ + deviceId: string; + + /** + * Name of the bundle where the peer ability locates. The name is case sensitive. + * @since 5 + */ + bundleName: string; + + /** + * Peer ability name, which is case sensitive. + * @since 5 + */ + abilityName: string; + + /** + * Messages received from the device. + * @since 5 + */ + message: string; +} + +/** + * @since 5 + * @systemapi + * @deprecated since 8 + */ +export interface SendMessageOptions { + /** + * Destination device ID. + * @since 5 + */ + deviceId: string; + + /** + * Name of the destination bundle where the ability locates. The name is case sensitive. + * @since 5 + */ + bundleName: string; + + /** + * Destination ability name, which is case sensitive. + * @since 5 + */ + abilityName: string; + + /** + * Messages sent to the destination device. + * A maximum of 1 KB of data can be transmitted at a time. + * If more than 1 KB of data needs to be transmitted, split the messages into multiple parts to transmit. + * @since 5 + */ + message?: string; + + /** + * Called when the messages are sent successfully. + * @since 5 + */ + success?: () => void; + + /** + * Called when the messages fail to be sent. + * @since 5 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 5 + */ + complete?: () => void; +} + +/** + * @since 5 + * @systemapi + * @deprecated since 8 + */ +export interface SubscribeMessageOptions { + /** + * Called when the messages are sent successfully. + * @since 5 + */ + success?: (data: SubscribeMessageResponse) => void; + + /** + * Called when the messages fail to be sent. + * @since 5 + */ + fail?: (data: string, code: number) => void; +} + +/** + * @since 5 + * @deprecated since 8 + */ +export declare class FeatureAbility { + /** + * Sends messages to the destination device. + * @param options Options. + * @since 5 + * @systemapi + * @deprecated since 8 + */ + static sendMsg(options: SendMessageOptions): void; + + /** + * Listens for messages sent from other devices. + * @param options Options. + * @since 5 + * @systemapi + * @deprecated since 8 + */ + static subscribeMsg(options: SubscribeMessageOptions): void; + + /** + * Cancels the listening for messages sent from other devices. + * @since 5 + * @systemapi + * @deprecated since 8 + */ + static unsubscribeMsg(): void; +} diff --git a/api/common/lite/global.d.ts b/api/common/lite/global.d.ts index 6594563f790476500e2cf2f78173e96ab1442aa2..4c2f3f01936b5e253347102280a9f1aecd72621c 100644 --- a/api/common/lite/global.d.ts +++ b/api/common/lite/global.d.ts @@ -1,78 +1,78 @@ -/* - * 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. - */ - -/** - * Sets the interval for repeatedly calling a function. - * @param handler Indicates the function to be called repeatedly at the interval. - * @param delay Indicates the interval between each two calls, in milliseconds. The function will be called after this delay. - * @param arguments Indicates additional arguments to pass to "handler" when the timer goes off. - * @returns Returns the timer ID. - */ -export declare function setInterval( - handler: Function, - delay: number, - ...arguments: any[] -): number; - -/** - * Sets a timer after which a function will be executed. - * @param handler Indicates the function to be called after the timer goes off. - * @param delay Indicates the delay (in milliseconds) after which the function will be called. If this parameter is left empty, default value "0" will be used, which means that the function will be called immediately or as soon as possible. - * @param arguments Indicates additional arguments to pass to "handler" when the timer goes off. - * @returns Returns the timer ID. - */ -export declare function setTimeout( - handler: Function, - delay?: number, - ...arguments: any[] -): number; - -/** - * Cancels the interval set by " setInterval()". - * @param intervalID Indicates the timer ID returned by "setInterval()". - */ -export declare function clearInterval(intervalID?: number): void; - -/** - * Cancels the timer set by " setTimeout()". - * @param timeoutID Indicates the timer ID returned by "setTimeout()". - */ -export declare function clearTimeout(timeoutID?: number): void; - -/** - * Get the java interface instance. The java instance needs to register, otherwise it cannot be obtained. - * After obtaining the instance, you can call the function with the same name on the Java side. - * @param name Java interface name, including package path, such as com.example.test.timeinterfaceimpl. - * @returns A promise object is returned. The resolve callback is the object of PA. The reject callback returns the object containing code and error data. - * @since 5 - * @deprecated since 8 - */ -export declare function createLocalParticleAbility(name?: string): any; - -/** - * Conditional compilation for rich equipment - */ -export declare const STANDARD: string; - -/** - * Conditional compilation for lite equipment - */ -export declare const LITE: string; - -/** - * Defining syscap function. - * @since 8 - */ -export declare function canIUse(syscap: string): boolean; +/* + * 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. + */ + +/** + * Sets the interval for repeatedly calling a function. + * @param handler Indicates the function to be called repeatedly at the interval. + * @param delay Indicates the interval between each two calls, in milliseconds. The function will be called after this delay. + * @param arguments Indicates additional arguments to pass to "handler" when the timer goes off. + * @returns Returns the timer ID. + */ +export declare function setInterval( + handler: Function, + delay: number, + ...arguments: any[] +): number; + +/** + * Sets a timer after which a function will be executed. + * @param handler Indicates the function to be called after the timer goes off. + * @param delay Indicates the delay (in milliseconds) after which the function will be called. If this parameter is left empty, default value "0" will be used, which means that the function will be called immediately or as soon as possible. + * @param arguments Indicates additional arguments to pass to "handler" when the timer goes off. + * @returns Returns the timer ID. + */ +export declare function setTimeout( + handler: Function, + delay?: number, + ...arguments: any[] +): number; + +/** + * Cancels the interval set by " setInterval()". + * @param intervalID Indicates the timer ID returned by "setInterval()". + */ +export declare function clearInterval(intervalID?: number): void; + +/** + * Cancels the timer set by " setTimeout()". + * @param timeoutID Indicates the timer ID returned by "setTimeout()". + */ +export declare function clearTimeout(timeoutID?: number): void; + +/** + * Get the java interface instance. The java instance needs to register, otherwise it cannot be obtained. + * After obtaining the instance, you can call the function with the same name on the Java side. + * @param name Java interface name, including package path, such as com.example.test.timeinterfaceimpl. + * @returns A promise object is returned. The resolve callback is the object of PA. The reject callback returns the object containing code and error data. + * @since 5 + * @deprecated since 8 + */ +export declare function createLocalParticleAbility(name?: string): any; + +/** + * Conditional compilation for rich equipment + */ +export declare const STANDARD: string; + +/** + * Conditional compilation for lite equipment + */ +export declare const LITE: string; + +/** + * Defining syscap function. + * @since 8 + */ +export declare function canIUse(syscap: string): boolean; diff --git a/api/common/lite/index.d.ts b/api/common/lite/index.d.ts index 8712a2be0c6d8bd7db0dfa187cd0f1cfc2af817c..2b74cea7b798b0fbafa7e2d11546b2e1c18ca8f8 100644 --- a/api/common/lite/index.d.ts +++ b/api/common/lite/index.d.ts @@ -1,19 +1,19 @@ -/* - * 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. - */ - -export * from './viewmodel'; -export * from './featureability'; -export * from './console'; +/* + * 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. + */ + +export * from './viewmodel'; +export * from './featureability'; +export * from './console'; export * from './global'; \ No newline at end of file diff --git a/api/common/lite/viewmodel.d.ts b/api/common/lite/viewmodel.d.ts index cc51a0bd26d5c9742ede696118bc340e1437f898..bd234589864d362a5202097c4f3e5518cc755caa 100644 --- a/api/common/lite/viewmodel.d.ts +++ b/api/common/lite/viewmodel.d.ts @@ -1,118 +1,118 @@ -/* - * 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. - */ - -export interface ViewModel { - /** - * Displays content based on the current system language and a path of the language resource key specified through $t. - * @param path Path of the language resource key - * @param param Content used to replace placeholders during runtime. There are two types of placeholders available: - * 1. Named placeholder, for example, {name}. The actual content must be of the object type, for example, $t('strings.object', {name: 'Hello world'}). - * 2. Digit placeholder, for example, {0}. The actual content must be of the array type, for example, $t('strings.array', ['Hello world']). - * @returns content to display - */ - $t(path: string, param?: object | Array): string; - - /** - * An object that holds all DOM elements and component instances that have been registered with the refs attribute - */ - $refs: ElementReferences; -} - -export interface ListScrollToOptions { - /** - * specified position. - */ - index: number; -} - -export interface ListElement { - /** - * Scrolls the list to the position of the item at the specified index. - */ - scrollTo(position: ListScrollToOptions): void; -} - -export interface ImageAnimatorElement { - /** - * Starts to play the frame animation of an image. If this method is called again, the playback starts from the first frame. - */ - start(): void; - /** - * Pauses the frame animation playback of an image. - */ - pause(): void; - /** - * Stops the frame animation playback of an image. - */ - stop(): void; - /** - * Resumes the frame animation playback of an image. - */ - resume(): void; - /** - * Obtains the playback state. Available values are as follows: - * Playing - * Paused - * Stopped - */ - getState(): "Playing" | "Paused" | "Stopped"; -} - -export interface ElementReferences { - [k: string]: object & ListElement & ImageAnimatorElement; -} - -export interface Options> { - /** - * Data model of the page that can be converted into a JSON object. - * The attribute name cannot start with $ or an underscore (_) or contain the reserved words such as for, if, show, and tid. - * For a function, the return value must be an object. - * Set the value of data to the return value of the function during page initialization. - */ - data?: Data; - - /** - * Called when the page is initialized. This function can be called only once in a lifecycle. - */ - onInit?(): void; - - /** - * Called when the page is created. This function can be called only once in a lifecycle. - */ - onReady?(): void; - - /** - * Called when the page is displayed. - */ - onShow?(): void; - - /** - * Called when the application is created - */ - onCreate?(): void; - - /** - * Called when the application is destroyed or called when the page is redirected to another one (without entering the navigation stack). - */ - onDestroy?(): void; -} - -type DefaultData = object; -type CombinedOptions = object & - Options & - ThisType; -export declare function extendViewModel( - options: CombinedOptions -): ViewModel & Data; +/* + * 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. + */ + +export interface ViewModel { + /** + * Displays content based on the current system language and a path of the language resource key specified through $t. + * @param path Path of the language resource key + * @param param Content used to replace placeholders during runtime. There are two types of placeholders available: + * 1. Named placeholder, for example, {name}. The actual content must be of the object type, for example, $t('strings.object', {name: 'Hello world'}). + * 2. Digit placeholder, for example, {0}. The actual content must be of the array type, for example, $t('strings.array', ['Hello world']). + * @returns content to display + */ + $t(path: string, param?: object | Array): string; + + /** + * An object that holds all DOM elements and component instances that have been registered with the refs attribute + */ + $refs: ElementReferences; +} + +export interface ListScrollToOptions { + /** + * specified position. + */ + index: number; +} + +export interface ListElement { + /** + * Scrolls the list to the position of the item at the specified index. + */ + scrollTo(position: ListScrollToOptions): void; +} + +export interface ImageAnimatorElement { + /** + * Starts to play the frame animation of an image. If this method is called again, the playback starts from the first frame. + */ + start(): void; + /** + * Pauses the frame animation playback of an image. + */ + pause(): void; + /** + * Stops the frame animation playback of an image. + */ + stop(): void; + /** + * Resumes the frame animation playback of an image. + */ + resume(): void; + /** + * Obtains the playback state. Available values are as follows: + * Playing + * Paused + * Stopped + */ + getState(): "Playing" | "Paused" | "Stopped"; +} + +export interface ElementReferences { + [k: string]: object & ListElement & ImageAnimatorElement; +} + +export interface Options> { + /** + * Data model of the page that can be converted into a JSON object. + * The attribute name cannot start with $ or an underscore (_) or contain the reserved words such as for, if, show, and tid. + * For a function, the return value must be an object. + * Set the value of data to the return value of the function during page initialization. + */ + data?: Data; + + /** + * Called when the page is initialized. This function can be called only once in a lifecycle. + */ + onInit?(): void; + + /** + * Called when the page is created. This function can be called only once in a lifecycle. + */ + onReady?(): void; + + /** + * Called when the page is displayed. + */ + onShow?(): void; + + /** + * Called when the application is created + */ + onCreate?(): void; + + /** + * Called when the application is destroyed or called when the page is redirected to another one (without entering the navigation stack). + */ + onDestroy?(): void; +} + +type DefaultData = object; +type CombinedOptions = object & + Options & + ThisType; +export declare function extendViewModel( + options: CombinedOptions +): ViewModel & Data; diff --git a/build-tools/delete_systemapi_plugin.js b/build-tools/delete_systemapi_plugin.js new file mode 100644 index 0000000000000000000000000000000000000000..fcf3223a4f6ff5f7dfa3e01d31cb178d5a61c108 --- /dev/null +++ b/build-tools/delete_systemapi_plugin.js @@ -0,0 +1,191 @@ +/* + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const path = require('path'); +const fs = require('fs'); +const ts = require('typescript'); + +let sourceFile = null; +let lastNoteStr = ''; +let lastNodeName = ''; + +function collectDeclaration(url) { + const utPath = path.resolve(__dirname, url); + const utFiles = []; + readFile(utPath, utFiles); + tsTransform(utFiles, deleteSystemApi); +} + +function tsTransform(utFiles, callback) { + utFiles.forEach((url) => { + if (/\.json/.test(url) || /index\-full\.d\.ts/.test(url) || /common\.d\.ts/.test(url)) { + const content = fs.readFileSync(url, 'utf-8'); + writeFile(url, content); + } else if (/\.d\.ts/.test(url)) { + const content = fs.readFileSync(url, 'utf-8'); + const fileName = path.basename(url).replace(/.d.ts/g, '.ts'); + ts.transpileModule(content, { + compilerOptions: { + "target": ts.ScriptTarget.ES2017 + }, + fileName: fileName, + transformers: { before: [callback(url)] } + }); + } + }); +} + +function readFile(dir, utFiles) { + try { + const files = fs.readdirSync(dir); + files.forEach((element) => { + const filePath = path.join(dir, element); + const status = fs.statSync(filePath); + if (status.isDirectory()) { + readFile(filePath, utFiles); + } else { + utFiles.push(filePath); + } + }) + } catch (e) { + console.log('ETS ERROR: ' + e); + } +} + +function writeFile(url, data, option) { + if (fs.existsSync(outputPath)) { + fs.rmdirSync(outputPath, { recursive: true }); + } + const newFilePath = path.resolve(outputPath, path.relative(__dirname, url)); + fs.mkdir(path.relative(__dirname, path.dirname(newFilePath)), { recursive: true }, (err) => { + if (err) { + console.log(`ERROR FOR CREATE PATH ${err}`); + } else { + fs.writeFile(newFilePath, data, option, (err) => { + if (err) { + console.log(`ERROR FOR CREATE FILE ${err}`); + } + }) + } + }) +} +function deleteSystemApi(url) { + return (context) => { + return (node) => { + sourceFile = node; + node = processSourceFile(node); + node = ts.visitEachChild(node, processAllNodes, context); + if (!isEmptyFile(node)) { + const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed }); + const result = printer.printNode(ts.EmitHint.Unspecified, node, sourceFile); + writeFile(url, result); + } + return node; + } + function processAllNodes(node) { + if (ts.isInterfaceDeclaration(node)) { + const newMembers = []; + node.members.forEach(member => { + if (!isSystemapi(member)) { + newMembers.push(member); + } + }); + node = ts.factory.updateInterfaceDeclaration(node, node.decorators, node.modifiers, node.name, + node.typeParameters, node.heritageClauses, newMembers); + } else if (ts.isClassDeclaration(node)) { + const newMembers = []; + node.members.forEach(member => { + if (!isSystemapi(member)) { + newMembers.push(member); + } + }); + node = ts.factory.updateClassDeclaration(node, node.decorators, node.modifiers, node.name, + node.typeParameters, node.heritageClauses, newMembers); + } else if (ts.isModuleDeclaration(node) && node.body && ts.isModuleBlock(node.body)) { + const newStatements = []; + node.body.statements.forEach(statement => { + if (!isSystemapi(statement)) { + newStatements.push(statement); + } + }); + const newModuleBody = ts.factory.updateBlock(node.body, newStatements); + node = ts.factory.updateModuleDeclaration(node, node.decorators, node.modifiers, node.name, newModuleBody); + } else if (ts.isEnumDeclaration(node)) { + const newMembers = []; + node.members.forEach(member => { + if (!isSystemapi(member)) { + newMembers.push(member); + } + }); + node = ts.factory.updateEnumDeclaration(node, node.decorators, node.modifiers, node.name, newMembers); + } + return ts.visitEachChild(node, processAllNodes, context); + } + function processSourceFile(node) { + const stateNamesSet = new Set([]); + const newStatements = []; + const newStatementsWithoutExport = []; + node.statements.forEach(statement => { + if (!isSystemapi(statement)) { + newStatements.push(statement); + } else if (ts.isModuleDeclaration(statement) && statement.name && ts.isIdentifier(statement.name)) { + stateNamesSet.add(statement.name.escapedText.toString()); + } + }); + newStatements.forEach(statement => { + if (!(ts.isExportAssignment(statement) && statement.expression && ts.isIdentifier(statement.expression) && + stateNamesSet.has(statement.expression.escapedText.toString()))) { + newStatementsWithoutExport.push(statement); + } + }); + return ts.factory.updateSourceFile(node, newStatementsWithoutExport, node.isDeclarationFile, + node.referencedFiles); + } + } +} +exports.deleteSystemApi = deleteSystemApi; + +function isSystemapi(node) { + const notesStr = node.getFullText().replace(node.getText(), "").replace(/[\s]/g, ""); + if (notesStr.length !== 0) { + if (ts.isFunctionDeclaration(node) || ts.isMethodSignature(node) || ts.isMethodDeclaration(node)) { + lastNodeName = node.name && node.name.escapedText ? node.name.escapedText.toString() : ""; + lastNoteStr = notesStr; + } + return /\@systemapi/g.test(notesStr); + } else { + if ((ts.isFunctionDeclaration(node) || ts.isMethodSignature(node) || ts.isMethodDeclaration(node)) && node.name && + node.name.escapedText.toString() !== "" && node.name.escapedText.toString() === lastNodeName) { + return /\@systemapi/g.test(lastNoteStr); + } else { + return false; + } + } +} + +function isEmptyFile(node) { + if (ts.isSourceFile(node) && node.statements) { + for (let i = 0; i < node.statements.length; i++) { + const statement = node.statements[i]; + if (!ts.isImportDeclaration(statement)) { + return false + } + } + } + return true; +} + +const apiSourcePath = '../api'; +const outputPath = path.resolve(__dirname, 'output'); +collectDeclaration(apiSourcePath); \ No newline at end of file diff --git a/build-tools/package.json b/build-tools/package.json new file mode 100644 index 0000000000000000000000000000000000000000..738d7b4037844fea1402bfbf8c5a62e36f527739 --- /dev/null +++ b/build-tools/package.json @@ -0,0 +1,16 @@ +{ + "name": "delete", + "version": "1.0.0", + "description": "", + "main": "delete_systemapi_plugin.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "fs": "^0.0.1-security", + "path": "^0.12.7", + "typescript": "^4.7.4" + } +}