diff --git a/api/@ohos.commonEvent.d.ts b/api/@ohos.commonEvent.d.ts index 19d056ce6d8883244e5390d23838e2e02ec08ce7..c3dc0d5b8f9cb41a02e9375c8097a16ba97aedca 100644 --- a/api/@ohos.commonEvent.d.ts +++ b/api/@ohos.commonEvent.d.ts @@ -886,4 +886,4 @@ declare namespace commonEvent { } } -export default commonEvent; \ No newline at end of file +export default commonEvent; diff --git a/api/@ohos.wantAgent.d.ts b/api/@ohos.wantAgent.d.ts index 2bdd0a1f0b0bf4f57fc7b8cc5bce8380a8ecaf97..f7eab8a04f132e0681e147a410e316dde067d16f 100644 --- a/api/@ohos.wantAgent.d.ts +++ b/api/@ohos.wantAgent.d.ts @@ -16,6 +16,7 @@ import { AsyncCallback , Callback} from './basic'; import { Want } from './ability/want'; import { WantAgentInfo } from './wantAgent/wantAgentInfo'; +import { TriggerInfo } from './wantAgent/triggerInfo'; /** * Provide the method obtain trigger, cancel, and compare and to obtain @@ -23,17 +24,78 @@ import { WantAgentInfo } from './wantAgent/wantAgentInfo'; * * @name wantAgent * @since 7 - * @devices phone, tablet + * @devices phone, tablet, tv, wearable, car + * @import wantAgent from '@ohos.wantAgent'; * @permission N/A */ declare namespace wantAgent { + /** + * Obtains the bundle name of an {@link WantAgent}. + * + * @param agent Indicates the {@link WantAgent} whose bundle name is to be obtained. + * @return Returns the bundle name of the {@link WantAgent} if any. + * @since 7 + */ + function getBundleName(agent: WantAgent, callback: AsyncCallback): void; + function getBundleName(agent: WantAgent): Promise; + + /** + * Obtains the bundle name of an {@link WantAgent}. + * + * @param agent Indicates the {@link WantAgent} whose UID is to be obtained. + * @return Returns the UID of the {@link WantAgent} if any; returns {@code -1} otherwise. + * @since 7 + */ + function getUid(agent: WantAgent, callback: AsyncCallback): void; + function getUid(agent: WantAgent): Promise; + + /** + * Obtains the {@link Want} of an {@link WantAgent}. + * + * @param agent Indicates the {@link WantAgent} whose UID is to be obtained. + * @return Returns the {@link Want} of the {@link WantAgent}. + * @systemapi Hide this for inner system use. + * @since 7 + */ + function getWant(agent: WantAgent, callback: AsyncCallback): void; + function getWant(agent: WantAgent): Promise; + + /** + * Cancels an {@link WantAgent}. Only the application that creates the {@link IntentAgent} can cancel it. + * + * @param agent Indicates the {@link WantAgent} to cancel. + * @since 7 + */ + function cancel(agent: WantAgent, callback: AsyncCallback): void; + function cancel(agent: WantAgent): Promise; + + /** + * Obtains the bundle name of an {@link WantAgent}. + * + * @param agent Indicates the {@link WantAgent} whose bundle name is to be obtained. + * @param triggerInfo Indicates the {@link TriggerInfo} object that contains triggering parameters. + * @param callback Indicates the callback method to be called after the {@link WantAgent} is triggered. + * @since 7 + */ + function trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback): void; + + /** + * Checks whether two {@link WantAgent} objects are the same. + * + * @param agent Indicates one of the {@link WantAgent} object to compare. + * @param otherAgent Indicates the other {@link WantAgent} object to compare. + * @return Returns {@code true} If the two objects are the same; returns {@code false} otherwise. + * @since 7 + */ + function equal(agent: WantAgent, otherAgent: WantAgent, callback: AsyncCallback): void; + function equal(agent: WantAgent, otherAgent: WantAgent): Promise; + /** * Obtains an {@link WantAgent} object. * * @param info Indicates the {@link WantAgentInfo} object that contains parameters of the * {@link WantAgent} object to create. * @return Returns the created {@link WantAgent} object. - * * @since 7 */ function getWantAgent(info: WantAgentInfo, callback: AsyncCallback): void; @@ -69,6 +131,20 @@ declare namespace wantAgent { START_SERVICE, SEND_COMMON_EVENT } + + /** + * A callback for the {@link trigger()} method. After the method execution is complete, + * the callback process will start. + * + * @since 7 + */ + export interface CompleteData { + info: WantAgent; + want: Want; + finalCode: number; + finalData: string; + extraInfo?: {[key: string]: any}; + } } export type WantAgent = object; diff --git a/api/commonEvent/commonEventData.d.ts b/api/commonEvent/commonEventData.d.ts index 6447604ca61ad1292d2b0a7b41376d1fd2c24228..6e985c7156e1344d918407c3b9b2b91e074dcd43 100644 --- a/api/commonEvent/commonEventData.d.ts +++ b/api/commonEvent/commonEventData.d.ts @@ -49,4 +49,12 @@ export interface CommonEventData { * @since 7 */ data?: string; + + /** + * The description of the parameters in a common event. + * + * @default - + * @since 7 + */ + parameters?: {[key: string]: any}; } diff --git a/api/commonEvent/commonEventPublishData.d.ts b/api/commonEvent/commonEventPublishData.d.ts index b9e46b93b092abdb8030c419408a2b1624d7fff8..4c1dd0b5dd291b9d5062bb8984d183fa496cfbe3 100644 --- a/api/commonEvent/commonEventPublishData.d.ts +++ b/api/commonEvent/commonEventPublishData.d.ts @@ -66,4 +66,12 @@ export interface CommonEventPublishData { * @since 7 */ isSticky?: boolean; + + /** + * The description of the parameters in a common event. + * + * @default - + * @since 7 + */ + parameters?: {[key: string]: any}; } \ No newline at end of file diff --git a/api/commonEvent/commonEventSubscriber.d.ts b/api/commonEvent/commonEventSubscriber.d.ts index 1a8182bb1bfe58f007f41f9f8b3d7997b0e2c2f5..65e5aba3537b2b8ea2080f0f63e701c46cae7435 100644 --- a/api/commonEvent/commonEventSubscriber.d.ts +++ b/api/commonEvent/commonEventSubscriber.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ import { AsyncCallback } from './../basic'; -import { CommonEventSubscribeInfo } from './commoneventsubscribeinfo'; +import { CommonEventSubscribeInfo } from './commonEventSubscribeInfo'; /** * the subscriber of common event diff --git a/api/notification/notificationContent.d.ts b/api/notification/notificationContent.d.ts index 134218f5ef664ad113e734f1db893b6c24a64efc..7624cd304a6e7b08d1852f62296c449a32597e3e 100644 --- a/api/notification/notificationContent.d.ts +++ b/api/notification/notificationContent.d.ts @@ -14,6 +14,7 @@ */ import notification from '../@ohos.notification'; +import image from './@ohos.multimedia.image'; /** * Constructs basic notifications. @@ -61,9 +62,24 @@ export interface NotificationMultiLineContent extends NotificationBasicContent { } /** - * Constructs a notification that includes multiple lines of text. + * Constructs a notification that includes a picture. * - * @name NotificationMultiLineContent + * @name NotificationPictureContent + * @since 7 + * @sysCap SystemCapability.Notification.ANS + * @devices phone, tablet, tv, wearable, car + * @permission N/A + */ +export interface NotificationPictureContent extends NotificationBasicContent { + briefText: string; + expandedTitle: string; + picture: image.PixelMap; +} + +/** + * Constructs a notification. + * + * @name NotificationContent * @since 7 * @sysCap SystemCapability.Notification.ANS * @devices phone, tablet, tv, wearable, car @@ -74,4 +90,5 @@ export interface NotificationContent { normal?: NotificationBasicContent; longText?: NotificationLongTextContent; multiLine?: NotificationMultiLineContent; + picture?: NotificationPictureContent; } diff --git a/api/notification/notificationRequest.d.ts b/api/notification/notificationRequest.d.ts index 0914b648d2caaae1713c825d5e1ae9dad639ff94..f3e2657fe0b4ed4e0a8d7162e568f16c6b2c0c46 100644 --- a/api/notification/notificationRequest.d.ts +++ b/api/notification/notificationRequest.d.ts @@ -14,6 +14,7 @@ */ import notification from '../@ohos.notification'; +import image from '../@ohos.multimedia.image'; import { WantAgent } from '../@ohos.wantAgent'; import { NotificationContent } from './notificationContent'; import { NotificationActionButton } from './notificationActionButton'; @@ -48,6 +49,8 @@ export interface NotificationRequest { badgeIconStyle?: number; showDeliveryTime?: boolean; actionButtons?: Array; + smallIcon?: image.PixelMap; + largeIcon?: image.PixelMap; readonly creatorBundleName?: string; readonly creatorUid?: number; readonly creatorPid?: number; diff --git a/api/notification/notificationSorting.d.ts b/api/notification/notificationSorting.d.ts index 1a34e32fa242534466056aeb6a408260297e0389..a4d917145141ce36f5f9f2ca5e153cc738ccd152 100644 --- a/api/notification/notificationSorting.d.ts +++ b/api/notification/notificationSorting.d.ts @@ -22,6 +22,7 @@ import { NotificationSlot } from './notificationSlot'; * @sysCap SystemCapability.Notification.ANS * @devices phone, tablet, tv, wearable, car * @permission N/A + * @systemapi Hide this for inner system use. * @since 7 */ export interface NotificationSorting { diff --git a/api/notification/notificationSortingMap.d.ts b/api/notification/notificationSortingMap.d.ts index 829ddaf15c4e1d9af5966df56521faaccfd04905..2b2a73b4e4daf6f7bd9f1eaf407bf1346e6081b3 100644 --- a/api/notification/notificationSortingMap.d.ts +++ b/api/notification/notificationSortingMap.d.ts @@ -23,6 +23,7 @@ import { NotificationSorting } from './notificationSorting'; * @sysCap SystemCapability.Notification.ANS * @devices phone, tablet, tv, wearable, car * @permission N/A + * @systemapi Hide this for inner system use. */ interface NotificationSortingMap { readonly sortings: {[key: string]: NotificationSorting}; diff --git a/api/notification/notificationSubscribeInfo.ts b/api/notification/notificationSubscribeInfo.ts index ea1f69fc2ab770b6cf92ce12462d595cc7b18b9d..d7ee89bd9a53c526aec7dfcdbff571c80d199996 100644 --- a/api/notification/notificationSubscribeInfo.ts +++ b/api/notification/notificationSubscribeInfo.ts @@ -21,6 +21,7 @@ * @sysCap SystemCapability.Notification.ANS * @devices phone, tablet, tv, wearable, car * @permission N/A + * @systemapi Hide this for inner system use. */ export interface NotificationSubscribeInfo { bundleNames?: Array; diff --git a/api/wantAgent/triggerInfo.d.ts b/api/wantAgent/triggerInfo.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..20dfdeab1fc8bd7d13e886209198ea49f4e91f14 --- /dev/null +++ b/api/wantAgent/triggerInfo.d.ts @@ -0,0 +1,31 @@ +/* + * 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 '../ability/want'; + +/** + * the info when object of WantAgent trigger + * + * @name TriggerInfo + * @since 7 + * @devices phone, tablet, tv, wearable, car + * @permission N/A + */ +export interface TriggerInfo { + code: number; + want?: Want; + permission?: string; + extraInfo?: {[key: string]: any}; +} \ No newline at end of file diff --git a/api/wantAgent/wantAgentInfo.d.ts b/api/wantAgent/wantAgentInfo.d.ts index 4cc5aa29483145bc61d04637b86cfe002ef3ce34..d4d1c8705268dabffb6e72240f02633426371da3 100644 --- a/api/wantAgent/wantAgentInfo.d.ts +++ b/api/wantAgent/wantAgentInfo.d.ts @@ -21,8 +21,7 @@ import wantAgent from '../@ohos.wantAgent' * * @name WantAgentInfo * @since 7 - * @sysCap ans - * @devices phone, tablet + * @devices phone, tablet, tv, wearable, car * @permission N/A */ export interface WantAgentInfo {