From c53271a638390a25f91e1a413e92d798fb8bd502 Mon Sep 17 00:00:00 2001 From: zhongjianfei Date: Mon, 10 Jan 2022 11:12:24 +0800 Subject: [PATCH] zhongjianfei@huawei.com Signed-off-by: zhongjianfei Change-Id: Iaabcd22fc9a409965c78c6d2fc813f64c9bc2c5e --- api/@ohos.application.Ability.d.ts | 156 ++++++++++++++++++ api/@ohos.application.AbilityStage.d.ts | 44 +++++ api/@ohos.application.FormExtension.d.ts | 113 +++++++++++++ api/@ohos.application.ServiceExtension.d.ts | 112 +++++++++++++ api/@ohos.application.StartOptions.d.ts | 34 ++++ api/@ohos.application.Want.d.ts | 106 ++++++++++++ api/@ohos.application.appManager.d.ts | 66 ++++++++ api/@ohos.application.formBindingData.d.ts | 40 +++++ api/@ohos.application.missionManager.d.ts | 142 ++++++++++++++++ api/@ohos.notification.d.ts | 9 + api/application/AbilityContext.d.ts | 123 ++++++++++++++ api/application/AbilityStageContext.d.ts | 36 ++++ api/application/AbilityStateData.d.ts | 75 +++++++++ api/application/AppStateData.d.ts | 55 ++++++ api/application/ApplicationStateObserver.d.ts | 89 ++++++++++ api/application/Context.d.ts | 122 ++++++++++++++ api/application/ExtensionContext.d.ts | 36 ++++ api/application/FormExtensionContext.d.ts | 46 ++++++ api/application/MissionInfo.d.ts | 83 ++++++++++ api/application/MissionListener.d.ts | 66 ++++++++ api/application/MissionSnapshot.d.ts | 44 +++++ api/application/ProcessData.d.ts | 55 ++++++ api/application/ServiceExtensionContext.d.ts | 88 ++++++++++ api/notification/notificationRequest.d.ts | 8 + api/notification/notificationTemplate.d.ts | 35 ++++ 25 files changed, 1783 insertions(+) create mode 100644 api/@ohos.application.Ability.d.ts create mode 100644 api/@ohos.application.AbilityStage.d.ts create mode 100644 api/@ohos.application.FormExtension.d.ts create mode 100644 api/@ohos.application.ServiceExtension.d.ts create mode 100644 api/@ohos.application.StartOptions.d.ts create mode 100644 api/@ohos.application.Want.d.ts create mode 100644 api/@ohos.application.appManager.d.ts create mode 100644 api/@ohos.application.formBindingData.d.ts create mode 100644 api/@ohos.application.missionManager.d.ts create mode 100644 api/application/AbilityContext.d.ts create mode 100644 api/application/AbilityStageContext.d.ts create mode 100644 api/application/AbilityStateData.d.ts create mode 100644 api/application/AppStateData.d.ts create mode 100644 api/application/ApplicationStateObserver.d.ts create mode 100644 api/application/Context.d.ts create mode 100644 api/application/ExtensionContext.d.ts create mode 100644 api/application/FormExtensionContext.d.ts create mode 100644 api/application/MissionInfo.d.ts create mode 100644 api/application/MissionListener.d.ts create mode 100644 api/application/MissionSnapshot.d.ts create mode 100644 api/application/ProcessData.d.ts create mode 100644 api/application/ServiceExtensionContext.d.ts create mode 100644 api/notification/notificationTemplate.d.ts diff --git a/api/@ohos.application.Ability.d.ts b/api/@ohos.application.Ability.d.ts new file mode 100644 index 0000000000..acf28ef9c6 --- /dev/null +++ b/api/@ohos.application.Ability.d.ts @@ -0,0 +1,156 @@ +/* + * 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 AbilityContext from "./application/AbilityContext"; +import Want from './@ohos.application.Want'; +import window from './@ohos.window'; + +/** + * The class of an ability. + * + * @since 8 + * @sysCap AAFwk + * @devices phone, tablet, tv, wearable, car + * @permission N/A + */ +export default class Ability { + /** + * Indicates configuration information about an ability context. + * + * @since 8 + * @sysCap AAFwk + */ + context: AbilityContext; + + /** + * Indicates ability launch want. + * + * @since 8 + * @sysCap AAFwk + */ + launchWant: Want; + + /** + * Indicates ability last request want. + * + * @since 8 + * @sysCap AAFwk + */ + lastRequestWant: Want; + + /** + * Called back when an ability is started for initialization. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @return - + */ + onCreate(want: Want, param: LaunchParam): void; + + /** + * Called back when an ability window stage is created. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @return - + */ + onWindowStageCreate(windowStage: window.WindowStage): void; + + /** + * Called back when an ability window stage is destroyed. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @return - + */ + onWindowStageDestroy(): void; + + /** + * Called back before an ability is destroyed. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @return - + */ + onDestroy(): void; + + /** + * Called back when the state of an ability changes to foreground. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @return - + */ + onForeground(): void; + + /** + * Called back when the state of an ability changes to background. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @return - + */ + onBackground(): void; +} + +export interface LaunchParam { + /** + * Indicates launch reason. + * + * @since 8 + * @sysCap AAFwk + */ + launchReason: LaunchReason; + + /** + * Indicates last exit reason. + * + * @since 8 + * @sysCap AAFwk + */ + lastExitReason: LastExitReason; +} + +/** + * Type of launch reason. + * + * @since 8 + * @sysCap AAFwk + */ +export enum LaunchReason { + UNKNOWN = 0, + START_ABILITY = 1, + CALL = 2, + CONTINUATION = 3, +} + +/** + * Type of last exit reason. + * + * @since 8 + * @sysCap AAFwk + */ +export enum LastExitReason { + UNKNOWN = 0, + ABILITY_NOT_RESPONDING = 1, + NORMAL = 2, +} + diff --git a/api/@ohos.application.AbilityStage.d.ts b/api/@ohos.application.AbilityStage.d.ts new file mode 100644 index 0000000000..c552646d49 --- /dev/null +++ b/api/@ohos.application.AbilityStage.d.ts @@ -0,0 +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. + */ + +import AbilityStageContext from "./application/AbilityStageContext"; + +/** + * The class of an ability stage. + * + * @since 8 + * @sysCap AAFwk + * @devices phone, tablet, tv, wearable, car + * @permission N/A + */ +export default class AbilityStage { + /** + * Indicates configuration information about context. + * + * @since 8 + * @sysCap AAFwk + */ + context: AbilityStageContext; + + /** + * Called back when an ability stage is started for initialization. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @return - + */ + onCreate(): void; +} \ No newline at end of file diff --git a/api/@ohos.application.FormExtension.d.ts b/api/@ohos.application.FormExtension.d.ts new file mode 100644 index 0000000000..ea608614d1 --- /dev/null +++ b/api/@ohos.application.FormExtension.d.ts @@ -0,0 +1,113 @@ +/* + * 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 formBindingData from './@ohos.application.formBindingData'; +import FormExtensionContext from "./application/FormExtensionContext"; +import Want from './@ohos.application.Want'; + +/** + * class of form extension. + * + * @since 8 + * @sysCap AAFwk + * @devices phone, tablet, tv, wearable, car + */ +export default class FormExtension { + /** + * Indicates form extension context. + * + * @since 8 + * @sysCap AAFwk + */ + context: FormExtensionContext; + + /** + * Called to return a {@link formBindingData#FormBindingData} object. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param want Indicates the detailed information for creating a {@link formBindingData#FormBindingData}. + * The {@code Want} object must include the form ID, form name, and grid style of the form. + * Such form information must be managed as persistent data for further form + * acquisition, update, and deletion. + * @return Returns the created {@link formBindingData#FormBindingData} object. + */ + onCreate(want: Want): formBindingData.FormBindingData; + + /** + * Called when the form provider is notified that a temporary form is successfully converted to a normal form. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param formId Indicates the ID of the form. + * @return - + */ + onCastToNormal(formId: string): void; + + /** + * Called to notify the form provider to update a specified form. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param formId Indicates the ID of the form to update. + * @return - + */ + onUpdate(formId: string): void; + + /** + * Called when the form provider receives form events from the system. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param newStatus Indicates the form events occurred. The key in the {@code Map} object indicates the form ID, + * and the value indicates the event type, which can be either {@link formManager#VisibilityType#FORM_VISIBLE} + * or {@link formManager#VisibilityType#FORM_INVISIBLE}. {@link formManager#VisibilityType#FORM_VISIBLE} + * means that the form becomes visible, and {@link formManager#VisibilityType#FORM_INVISIBLE} + * means that the form becomes invisible. + * @return - + */ + onVisibilityChange(newStatus: { [key: string]: number }): void; + + /** + * Called when a specified message event defined by the form provider is triggered. This method is valid only for + * JS forms. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param formId Indicates the ID of the form on which the message event is triggered, which is provided by + * the client to the form provider. + * @param message Indicates the value of the {@code params} field of the message event. This parameter is + * used to identify the specific component on which the event is triggered. + * @return - + */ + onEvent(formId: string, message: string): void; + + /** + * Called to notify the form provider that a specified form has been destroyed. Override this method if + * you want your application, as the form provider, to be notified of form deletion. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param formId Indicates the ID of the destroyed form. + * @return - + */ + onDestroy(formId: string): void; +} \ No newline at end of file diff --git a/api/@ohos.application.ServiceExtension.d.ts b/api/@ohos.application.ServiceExtension.d.ts new file mode 100644 index 0000000000..bb4e660bff --- /dev/null +++ b/api/@ohos.application.ServiceExtension.d.ts @@ -0,0 +1,112 @@ +/* + * 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 rpc from "./@ohos.rpc"; +import ServiceExtensionContext from "./application/ServiceExtensionContext"; +import Want from './@ohos.application.Want'; + +/** + * class of service extension. + * + * @since 8 + * @sysCap AAFwk + * @devices phone, tablet, tv, wearable, car + * @systemapi hide for inner use. + */ +export default class ServiceExtension { + /** + * Indicates service extension context. + * + * @since 8 + * @sysCap AAFwk + * @systemapi hide for inner use. + */ + context: ServiceExtensionContext; + + /** + * Called back when a service extension is started for initialization. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @systemapi hide for inner use. + * @return - + */ + onCreate(want: Want): void; + + /** + * Called back before a service extension is destroyed. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @systemapi hide for inner use. + * @return - + */ + onDestroy(): void; + + /** + * Called back when a service extension is started. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param want Indicates the want of service extension to start. + * @param startId Indicates the number of times the service extension has been started. The {@code startId} is + * incremented by 1 every time the service extension is started. For example, if the service extension + * has been started for six times. + * @systemapi hide for inner use. + * @return - + */ + onRequest(want: Want, startId: number): void; + + /** + * Called back when a service extension is first connected to an ability. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param want Indicates connection information about the Service ability. + * @systemapi hide for inner use. + * @return Returns the proxy of the Service ability. + */ + onConnect(want: Want): rpc.RemoteObject; + + /** + * Called back when all abilities connected to a service extension are disconnected. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param want Indicates disconnection information about the service extension. + * @systemapi hide for inner use. + * @return - + */ + onDisconnect(want: Want): void; + + /** + * Called when a new client attempts to connect to a service extension after all previous client connections to it + * are disconnected. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param want Indicates the want of the service extension being connected. + * @systemapi hide for inner use. + * @return - + */ + onReconnect(want: Want): void; +} + diff --git a/api/@ohos.application.StartOptions.d.ts b/api/@ohos.application.StartOptions.d.ts new file mode 100644 index 0000000000..c9678c0e64 --- /dev/null +++ b/api/@ohos.application.StartOptions.d.ts @@ -0,0 +1,34 @@ +/* + * 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. + */ + +/** + * StartOptions is the basic communication component of the system. + * + * @name StartOptions + * @since 8 + * @sysCap AAFwk + * @devices phone, tablet, tv, wearable, car + * @permission N/A + */ +export default class StartOptions { + /** + * windowMode + * @default - + * @devices phone, tablet + * @since 8 + * @sysCap AAFwk + */ + windowMode?: number; +} \ No newline at end of file diff --git a/api/@ohos.application.Want.d.ts b/api/@ohos.application.Want.d.ts new file mode 100644 index 0000000000..3a6db54e56 --- /dev/null +++ b/api/@ohos.application.Want.d.ts @@ -0,0 +1,106 @@ +/* + * 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. + */ + +/** + * Want is the basic communication component of the system. + * + * @name Want + * @since 8 + * @sysCap AAFwk + * @devices phone, tablet, tv, wearable, car + * @permission N/A + */ +export default class Want { + /** + * device id + * @default - + * @devices phone, tablet + * @since 8 + * @sysCap AAFwk + */ + deviceId?: string; + + /** + * bundle name + * @default - + * @devices phone, tablet + * @since 8 + * @sysCap AAFwk + */ + bundleName?: string; + + /** + * ability name + * @default - + * @devices phone, tablet + * @since 8 + * @sysCap AAFwk + */ + abilityName?: string; + + /** + * The description of a URI in a Want. + * @devices phone, tablet + * @since 8 + * @sysCap AAFwk + * @default - + */ + uri?: string; + + /** + * The description of the type in this Want. + * @devices phone, tablet + * @since 8 + * @sysCap AAFwk + * @default - + */ + type?: string; + + /** + * The options of the flags in this Want. + * @devices phone, tablet + * @since 8 + * @sysCap AAFwk + * @default - + */ + flags?: number; + + /** + * The description of an action in an want. + * @devices phone, tablet + * @since 8 + * @sysCap AAFwk + * @default - + */ + action?: string; + + /** + * The description of the WantParams object in an Want + * @devices phone, tablet + * @since 8 + * @sysCap AAFwk + * @default - + */ + parameters?: {[key: string]: any}; + + /** + * The description of a entities in a Want. + * @devices phone, tablet + * @since 8 + * @sysCap AAFwk + * @default - + */ + entities?: Array; +} \ No newline at end of file diff --git a/api/@ohos.application.appManager.d.ts b/api/@ohos.application.appManager.d.ts new file mode 100644 index 0000000000..f8428c4c82 --- /dev/null +++ b/api/@ohos.application.appManager.d.ts @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from './basic'; +import ApplicationStateObserver from './application/ApplicationStateObserver'; +import AppStateData from './application/AppStateData'; + +/** + * This module provides the function of app manager service. + * + * @since 8 + * @SysCap appexecfwk + * @devices phone, tablet, tv, wearable, car + * @import import appManager from '@ohos.application.appManager' + * @permission N/A + */ +declare namespace appManager { + /** + * Register application state observer. + * + * @default - + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @SysCap appexecfwk + * @param observer The application state observer. + * @return Returns the number code of the observer. + */ + function registerApplicationStateObserver(observer: ApplicationStateObserver): number; + + /** + * Unregister application state observer. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @SysCap appexecfwk + * @param observerId Indicates the number code of the observer. + * @return - + */ + function unregisterApplicationStateObserver(observerId: number, callback: AsyncCallback): void; + function unregisterApplicationStateObserver(observerId: number): Promise; + + /** + * getForegroundApplications. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @SysCap appexecfwk + * @return Returns the list of AppStateData. + */ + function getForegroundApplications(callback: AsyncCallback>): void; + function getForegroundApplications(): Promise>; +} + +export default appManager; diff --git a/api/@ohos.application.formBindingData.d.ts b/api/@ohos.application.formBindingData.d.ts new file mode 100644 index 0000000000..04208c8342 --- /dev/null +++ b/api/@ohos.application.formBindingData.d.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +/** + * interface of formBindingData. + * + * @name formBindingData + * @since 8 + * @sysCap AAFwk + * @devices phone, tablet, tv, wearable, car + */ +declare namespace formBindingData { + /** + * Create an FormBindingData instance. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param obj Indicates the FormBindingData instance data. + * @return Returns the {@link FormBindingData} instance. + */ + function createFormBindingData(obj: Object | string): FormBindingData; + + interface FormBindingData { + data: Object + } +} +export default formBindingData; \ No newline at end of file diff --git a/api/@ohos.application.missionManager.d.ts b/api/@ohos.application.missionManager.d.ts new file mode 100644 index 0000000000..0c4d323a2f --- /dev/null +++ b/api/@ohos.application.missionManager.d.ts @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from './basic'; +import { MissionInfo } from './application/MissionInfo'; +import { MissionListener } from './application/MissionListener'; +import { MissionSnapshot } from './application/MissionSnapshot'; + +/** + * This module provides the capability to manage abilities and obtaining system task information. + * + * @name missionManager + * @since 8 + * @sysCap AAFwk + * @devices phone, tablet + * @permission N/A + * @systemapi hide for inner use. + */ +declare namespace missionManager { + /** + * Register the missionListener to ams. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @return The index number of the MissionListener. + */ + function registerMissionListener(listener: MissionListener): number; + + /** + * Unrgister the missionListener to ams. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @return - + */ + function unregisterMissionListener(listenerId: number, callback: AsyncCallback): void; + function unregisterMissionListener(listenerId: number): Promise; + + /** + * Get the missionInfo with the given missionId. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @return the {@link MissionInfo} of the given id. + */ + function getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback): void; + function getMissionInfo(deviceId: string, missionId: number): Promise; + + /** + * Get the missionInfo with the given missionId. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @return The array of the {@link MissionInfo}. + */ + function getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback>): void; + function getMissionInfos(deviceId: string, numMax: number): Promise>; + + /** + * Get the mission snapshot with the given missionId. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @return The {@link MissionSnapshot} of the given id. + */ + function getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback): void; + function getMissionSnapShot(deviceId: string, missionId: number): Promise; + + /** + * Lock the mission. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @return - + */ + function lockMission(missionId: number, callback: AsyncCallback): void; + function lockMission(missionId: number): Promise; + + /** + * Unlock the mission. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @return - + */ + function unlockMission(missionId: number, callback: AsyncCallback): void; + function unlockMission(missionId: number): Promise; + + /** + * Clear the given mission in the ability manager service. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @return - + */ + function clearMission(missionId: number, callback: AsyncCallback): void; + function clearMission(missionId: number): Promise; + + /** + * Clear all missions in the ability manager service. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @return - + */ + function clearAllMissions(callback: AsyncCallback): void; + function clearAllMissions(): Promise; + + /** + * Schedule the given mission to foreground. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @return - + */ + function moveMissionToFront(missionId: number, callback: AsyncCallback): void; + function moveMissionToFront(missionId: number): Promise; +} + +export default missionManager; \ No newline at end of file diff --git a/api/@ohos.notification.d.ts b/api/@ohos.notification.d.ts index 661c8d46d9..c24a7a258e 100644 --- a/api/@ohos.notification.d.ts +++ b/api/@ohos.notification.d.ts @@ -543,6 +543,15 @@ declare namespace notification { function supportDoNotDisturbMode(callback: AsyncCallback): void; function supportDoNotDisturbMode(): Promise; + /** + * Obtains whether the template is supported by the system. + * + * @since 8 + * @param templateName Name of template to be Obtained + */ + function isSupportTemplate(templateName: string, callback: AsyncCallback): void; + function isSupportTemplate(templateName: string): Promise; + /** * Describes a BundleOption. */ diff --git a/api/application/AbilityContext.d.ts b/api/application/AbilityContext.d.ts new file mode 100644 index 0000000000..3cec14e13d --- /dev/null +++ b/api/application/AbilityContext.d.ts @@ -0,0 +1,123 @@ +/* + * 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 "../bundle/abilityInfo"; +import { AbilityResult } from "../ability/abilityResult"; +import { AsyncCallback } from "../basic"; +import { ConnectOptions } from "../ability/connectOptions"; +import { HapModuleInfo } from "../bundle/hapModuleInfo"; +import Context from "./Context"; +import Want from "../@ohos.application.Want"; +import StartOptions from "../@ohos.application.StartOptions"; + +/** + * The context of an ability. It allows access to ability-specific resources. + * + * @since 8 + * @sysCap AAFwk + * @devices phone, tablet, tv, wearable, car + * @permission N/A + */ +export default class AbilityContext extends Context { + /** + * Indicates configuration information about an ability. + * + * @since 8 + * @sysCap AAFwk + */ + abilityInfo: AbilityInfo; + + /** + * Indicates configuration information about an module. + * + * @since 8 + * @sysCap AAFwk + */ + currentHapModuleInfo: HapModuleInfo; + + /** + * Starts a new ability. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param parameter Indicates the ability to start. + * @return - + */ + startAbility(want: Want, callback: AsyncCallback): void; + startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; + startAbility(want: Want, options?: StartOptions): Promise; + + /** + * Starts an ability and returns the execution result when the ability is destroyed. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param parameter Indicates the ability to start. + * @return Returns the {@link AbilityResult}. + */ + startAbilityForResult(want: Want, callback: AsyncCallback): void; + startAbilityForResult(want: Want): Promise; + + /** + * Destroys this Page ability. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @return - + */ + terminateSelf(callback: AsyncCallback): void; + terminateSelf(): Promise; + + /** + * Sets the result code and data to be returned by this Page ability to the caller + * and destroys this Page ability. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param parameter Indicates the result to return. + * @return - + */ + terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback): void; + terminateSelfWithResult(parameter: AbilityResult): Promise; + + /** + * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param want The element name of the service ability + * @param options The remote object instance + * @hide hide for inner use. + * @return Returns the number code of the ability connected + */ + connectAbility(want: Want, options: ConnectOptions): number; + + /** + * The callback interface was connect successfully. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param connection The number code of the ability connected + * @hide hide for inner use. + */ + disconnectAbility(connection: number, callback:AsyncCallback): void; + disconnectAbility(connection: number): Promise; +} \ No newline at end of file diff --git a/api/application/AbilityStageContext.d.ts b/api/application/AbilityStageContext.d.ts new file mode 100644 index 0000000000..d9d3588f0a --- /dev/null +++ b/api/application/AbilityStageContext.d.ts @@ -0,0 +1,36 @@ +/* + * 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 { HapModuleInfo } from "../bundle/hapModuleInfo"; +import Context from "./Context"; + +/** + * The context of an abilityStage. It allows access to abilityStage-specific resources. + * + * @since 8 + * @sysCap AAFwk + * @devices phone, tablet, tv, wearable, car + * @permission N/A + */ +export default class AbilityStageContext extends Context { + + /** + * Indicates configuration information about an module. + * + * @since 8 + * @sysCap AAFwk + */ + currentHapModuleInfo: HapModuleInfo; +} \ No newline at end of file diff --git a/api/application/AbilityStateData.d.ts b/api/application/AbilityStateData.d.ts new file mode 100644 index 0000000000..066ec21a46 --- /dev/null +++ b/api/application/AbilityStateData.d.ts @@ -0,0 +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. + */ + +/** + * The ability or extension state data. + * + * @since 8 + * @sysCap appexecfwk + * @devices phone, tablet, tv, wearable, car + * @systemapi hide for inner use. + * @permission N/A + */ +export default class AbilityStateData { + /** + * The bundle name. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap appexecfwk + * @systemapi hide for inner use. + */ + bundleName: string; + + /** + * The ability name. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap appexecfwk + * @systemapi hide for inner use. + */ + abilityName: string; + + /** + * The pid. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap appexecfwk + * @systemapi hide for inner use. + */ + pid: number; + + /** + * The uid. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap appexecfwk + * @systemapi hide for inner use. + */ + uid: number; + + /** + * The application state. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap appexecfwk + * @systemapi hide for inner use. + */ + state: number; +} \ No newline at end of file diff --git a/api/application/AppStateData.d.ts b/api/application/AppStateData.d.ts new file mode 100644 index 0000000000..2c9ddc7720 --- /dev/null +++ b/api/application/AppStateData.d.ts @@ -0,0 +1,55 @@ +/* + * 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 application state data. + * + * @since 8 + * @sysCap appexecfwk + * @devices phone, tablet, tv, wearable, car + * @systemapi hide for inner use. + * @permission N/A + */ +export default class AppStateData { + /** + * The bundle name. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap appexecfwk + * @systemapi hide for inner use. + */ + bundleName: string; + + /** + * The uid. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap appexecfwk + * @systemapi hide for inner use. + */ + uid: number; + + /** + * The application state. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap appexecfwk + * @systemapi hide for inner use. + */ + state: number; +} \ No newline at end of file diff --git a/api/application/ApplicationStateObserver.d.ts b/api/application/ApplicationStateObserver.d.ts new file mode 100644 index 0000000000..4c45a87c3d --- /dev/null +++ b/api/application/ApplicationStateObserver.d.ts @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import AppStateData from "./AppStateData"; +import AbilityStateData from "./AbilityStateData"; +import ProcessData from "./ProcessData"; + +/** + * The application state observer. + * + * @since 8 + * @sysCap appexecfwk + * @devices phone, tablet, tv, wearable, car + * @systemapi hide for inner use. + * @permission N/A + */ +export default class ApplicationStateObserver { + /** + * Will be called when foreground or background application changed. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap appexecfwk + * @param appStateData State changed Application info. + * @systemapi hide for inner use. + * @return - + */ + onForegroundApplicationChanged(appStateData: AppStateData): void; + + /** + * Will be called when ability state changed. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap appexecfwk + * @param abilityStateData State changed ability info. + * @systemapi hide for inner use. + * @return - + */ + onAbilityStateChanged(abilityStateData: AbilityStateData): void; + + /** + * Will be called when extension state changed. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap appexecfwk + * @param abilityStateData State changed extension info. + * @systemapi hide for inner use. + * @return - + */ + onExtensionStateChanged(abilityStateData: AbilityStateData): void; + + /** + * Will be called when process created. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap appexecfwk + * @param processData Process info. + * @systemapi hide for inner use. + * @return - + */ + onProcessCreated(processData: ProcessData): void; + + /** + * Will be called when process died. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap appexecfwk + * @param processData Process info. + * @systemapi hide for inner use. + * @return - + */ + onProcessDied(processData: ProcessData): void; +} \ No newline at end of file diff --git a/api/application/Context.d.ts b/api/application/Context.d.ts new file mode 100644 index 0000000000..db1912de81 --- /dev/null +++ b/api/application/Context.d.ts @@ -0,0 +1,122 @@ +/* + * 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 "../bundle/applicationInfo"; +import resmgr from "../@ohos.resourceManager"; + +/** + * The base context of an ability or an application. It allows access to + * application-specific resources. + * + * @since 8 + * @sysCap AAFwk + * @devices phone, tablet, tv, wearable, car + * @permission N/A + */ +export default class Context { + /** + * Indicates the capability of accessing application resources. + * + * @since 8 + * @sysCap AAFwk + */ + resourceManager: resmgr.ResourceManager; + + /** + * Indicates configuration information about an application. + * + * @since 8 + * @sysCap AAFwk + */ + applicationInfo: ApplicationInfo; + + /** + * Indicates app cache dir. + * + * @since 8 + * @sysCap AAFwk + */ + cacheDir: string; + + /** + * Indicates app temp dir. + * + * @since 8 + * @sysCap AAFwk + */ + tempDir: string; + + /** + * Indicates app files dir. + * + * @since 8 + * @sysCap AAFwk + */ + filesDir : string; + + /** + * Indicates app database dir. + * + * @since 8 + * @sysCap AAFwk + */ + databaseDir : string; + + /** + * Indicates app storage dir. + * + * @since 8 + * @sysCap AAFwk + */ + storageDir : string; + + /** + * Indicates app bundle code dir. + * + * @since 8 + * @sysCap AAFwk + */ + bundleCodeDir : string; + + /** + * Indicates app distributed files dir. + * + * @since 8 + * @sysCap AAFwk + */ + distributedFilesDir: string; + + /** + * Create a bundle context + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @systemapi hide for inner use. + * @param bundleName Indicates the bundle name. + * @return application context + */ + createBundleContext(bundleName: string): Context; + + /** + * Get application context + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @return application context + */ + getApplicationContext(): Context; +} \ No newline at end of file diff --git a/api/application/ExtensionContext.d.ts b/api/application/ExtensionContext.d.ts new file mode 100644 index 0000000000..6033c35b12 --- /dev/null +++ b/api/application/ExtensionContext.d.ts @@ -0,0 +1,36 @@ +/* + * 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 { HapModuleInfo } from "../bundle/hapModuleInfo"; +import Context from "./Context"; + +/** + * The context of an extension. It allows access to extension-specific resources. + * + * @since 8 + * @sysCap AAFwk + * @devices phone, tablet, tv, wearable, car + * @permission N/A + */ +export default class ExtensionContext extends Context { + + /** + * Indicates configuration information about an module. + * + * @since 8 + * @sysCap AAFwk + */ + currentHapModuleInfo: HapModuleInfo; +} \ No newline at end of file diff --git a/api/application/FormExtensionContext.d.ts b/api/application/FormExtensionContext.d.ts new file mode 100644 index 0000000000..68b378a331 --- /dev/null +++ b/api/application/FormExtensionContext.d.ts @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from "../basic"; +import ExtensionContext from "./ExtensionContext"; +import formBindingData from '../@ohos.application.formBindingData'; + +/** + * The context of form extension. It allows access to + * formExtension-specific resources. + * + * @since 8 + * @sysCap AAFwk + * @devices phone, tablet, tv, wearable, car + * @permission N/A + */ +export default class FormExtensionContext extends ExtensionContext { + + /** + * update the given form. + * + *

You can use this method to update the given form

+ * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @permission ohos.permission.REQUIRE_FORM. + * @param formId Indicates the given form. + * @param formBindingData Indicates the form data. + * @return - + */ + updateForm(formId: string, formBindingData: formBindingData.FormBindingData, callback: AsyncCallback): void; + updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Promise; +} \ No newline at end of file diff --git a/api/application/MissionInfo.d.ts b/api/application/MissionInfo.d.ts new file mode 100644 index 0000000000..6a4d3e94c1 --- /dev/null +++ b/api/application/MissionInfo.d.ts @@ -0,0 +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 Want from "../@ohos.application.Want"; + +/** + * Mission information corresponding to ability. + * + * @since 8 + * @sysCap AAFwk + * @devices phone, tablet, tv, wearable, car + * @permission N/A + * @systemapi hide for inner use. + */ +export interface MissionInfo { + /** + * Indicates mission id. + * + * @since 8 + * @sysCap AAFwk + */ + missionId: number; + + /** + * Indicates running state. + * + * @since 8 + * @sysCap AAFwk + */ + runningState: number; + + /** + * Indicates locked state. + * + * @since 8 + * @sysCap AAFwk + */ + lockedState: number; + + /** + * Indicates the recent create or update time of the mission. + * + * @since 8 + * @sysCap AAFwk + */ + timestamp: string; + + /** + * Indicates want of the mission. + * + * @since 8 + * @sysCap AAFwk + */ + want: Want; + + /** + * Indicates label of the mission. + * + * @since 8 + * @sysCap AAFwk + */ + label: string; + + /** + * Indicates icon path of the mission. + * + * @since 8 + * @sysCap AAFwk + */ + iconPath: string; +} \ No newline at end of file diff --git a/api/application/MissionListener.d.ts b/api/application/MissionListener.d.ts new file mode 100644 index 0000000000..92c1758f00 --- /dev/null +++ b/api/application/MissionListener.d.ts @@ -0,0 +1,66 @@ +/* + * 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. + */ + +/** + * MissionListener registered by app. + * + * @name MissionListener + * @since 8 + * @sysCap AAFwk + * @devices phone, tablet + * @permission N/A + * @systemapi hide for inner use. + */ + export interface MissionListener { + /** + * Called by system when mission created. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @return - + */ + onMissionCreated(mission: number): void; + + /** + * Called by system when mission destroyed. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @return - + */ + onMissionDestroyed(mission: number): void; + + /** + * Called by system when mission shapshot changed. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @return - + */ + onMissionSnapshotChanged(mission: number): void; + + /** + * Called by system when mission moved to fornt. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @return - + */ + onMissionMovedToFront(mission: number): void; +} \ No newline at end of file diff --git a/api/application/MissionSnapshot.d.ts b/api/application/MissionSnapshot.d.ts new file mode 100644 index 0000000000..394fcdb2bb --- /dev/null +++ b/api/application/MissionSnapshot.d.ts @@ -0,0 +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. + */ + +import { ElementName } from '../bundle/elementName'; +import { image } from '../@ohos.multimedia.image'; + +/** + * Mission snapshot corresponding to mission. + * + * @since 8 + * @sysCap AAFwk + * @devices phone, tablet, tv, wearable, car + * @permission N/A + * @systemapi hide for inner use. + */ +export interface MissionSnapshot { + /** + * Indicates the ability elementName of the mission. + * + * @since 8 + * @sysCap AAFwk + */ + ability: ElementName; + + /** + * Indicates mission snapshot. + * + * @since 8 + * @sysCap AAFwk + */ + snapshot: image.PixelMap; +} \ No newline at end of file diff --git a/api/application/ProcessData.d.ts b/api/application/ProcessData.d.ts new file mode 100644 index 0000000000..50806b4fb3 --- /dev/null +++ b/api/application/ProcessData.d.ts @@ -0,0 +1,55 @@ +/* + * 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 process data. + * + * @since 8 + * @sysCap appexecfwk + * @devices phone, tablet, tv, wearable, car + * @systemapi hide for inner use. + * @permission N/A + */ +export default class ProcessData { + /** + * The bundle name. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap appexecfwk + * @systemapi hide for inner use. + */ + bundleName: string; + + /** + * The pid. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap appexecfwk + * @systemapi hide for inner use. + */ + pid: number; + + /** + * The uid. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap appexecfwk + * @systemapi hide for inner use. + */ + uid: number; +} \ No newline at end of file diff --git a/api/application/ServiceExtensionContext.d.ts b/api/application/ServiceExtensionContext.d.ts new file mode 100644 index 0000000000..a753bcc03c --- /dev/null +++ b/api/application/ServiceExtensionContext.d.ts @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from "../basic"; +import { ConnectOptions } from "../ability/connectOptions"; +import ExtensionContext from "./ExtensionContext"; +import Want from "../@ohos.application.Want"; +import StartOptions from "../@ohos.application.StartOptions"; + +/** + * The context of service extension. It allows access to + * serviceExtension-specific resources. + * + * @since 8 + * @sysCap AAFwk + * @devices phone, tablet, tv, wearable, car + * @systemapi hide for inner use. + * @permission N/A + */ +export default class ServiceExtensionContext extends ExtensionContext { + /** + * Service extension uses this method to start a specific ability. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param parameter Indicates the ability to start. + * @systemapi hide for inner use. + * @return - + */ + startAbility(want: Want, callback: AsyncCallback): void; + startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; + startAbility(want: Want, options?: StartOptions): Promise; + + /** + * Destroys this service extension. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @systemapi hide for inner use. + * @return - + */ + terminateSelf(callback: AsyncCallback): void; + terminateSelf(): Promise; + + /** + * Connects an ability to a Service extension. + * + *

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

+ * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param request Indicates the service extension to connect. + * @systemapi hide for inner use. + * @return connection id, int value. + */ + connectAbility(want: Want, options: ConnectOptions): number; + + /** + * Disconnects an ability to a service extension, in contrast to + * {@link connectAbility}. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @sysCap AAFwk + * @param connection the connection id returned from connectAbility api. + * @systemapi hide for inner use. + * @return - + */ + disconnectAbility(connection: number, callback:AsyncCallback): void; + disconnectAbility(connection: number): Promise; +} \ No newline at end of file diff --git a/api/notification/notificationRequest.d.ts b/api/notification/notificationRequest.d.ts index f5a27477ee..669a492e34 100644 --- a/api/notification/notificationRequest.d.ts +++ b/api/notification/notificationRequest.d.ts @@ -18,6 +18,7 @@ import image from '../@ohos.multimedia.image'; import { WantAgent } from '../@ohos.wantAgent'; import { NotificationContent } from './notificationContent'; import { NotificationActionButton } from './notificationActionButton'; +import { NotificationTemplate } from './notificationTemplate'; /** * Defines a NotificationRequest instance. @@ -189,4 +190,11 @@ export interface NotificationRequest { * @systemapi Hide this for inner system use. */ readonly source?: number; + + /** + * Obtains the template of this notification. + * + * @since 8 + */ + template?: NotificationTemplate; } diff --git a/api/notification/notificationTemplate.d.ts b/api/notification/notificationTemplate.d.ts new file mode 100644 index 0000000000..d131ed5cb2 --- /dev/null +++ b/api/notification/notificationTemplate.d.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +/** + * Describes a NotificationTemplate instance. + * + * @name NotificationTemplate + * @since 8 + * @devices phone, tablet, tv, wearable, car + * @permission N/A + * @sysCap SystemCapability.Notification.ANS + */ +export interface NotificationTemplate { + /** + * Obtains the type of a notification template. + */ + name: string; + + /** + * Obtains the data of a notification template. + */ + data: {[key: string]: Object}; +} -- Gitee