diff --git a/api/@ohos.notification.d.ts b/api/@ohos.notification.d.ts
index 869beba60ae1571b8d17f51e908d61aef11a6863..b1eb7f274a8d21dba6fa73a769434051c9060be2 100644
--- a/api/@ohos.notification.d.ts
+++ b/api/@ohos.notification.d.ts
@@ -34,6 +34,7 @@ import { NotificationRequest } from './notification/notificationRequest';
* @since 7
* @sysCap SystemCapability.Notification.ANS
* @devices phone, tablet, tv, wearable, car
+ * @import import notification from '@ohos.notification';
* @permission N/A
*/
declare namespace notification {
@@ -43,39 +44,29 @@ declare namespace notification {
*
If a notification with the same ID has been published by the current application and has not been deleted,
* this method will update the notification.
*
- * @param request Indicates the {@link NotificationRequest} object for setting the notification content.
- * This parameter must be specified.
- *
- * @since 7
+ * @param Publishes a notification.
*/
function publish(request: NotificationRequest, callback: AsyncCallback): void;
function publish(request: NotificationRequest): Promise;
/**
- * Cancels a published notification.
+ * Cancels a notification with the specified ID.
*
- * @param id Indicates the unique notification ID in the application. The value must be the ID
- * of a published notification. Otherwise, this method does not take effect.
- *
- * @since 7
+ * @param ID of the notification to cancel, which must be unique in the application.
*/
function cancel(id: number, callback: AsyncCallback): void;
/**
- * Cancels a published notification matching the specified {@code label} and {@code notificationId}.
- *
- * @param label Indicates the label of the notification to cancel.
- * @param id Indicates the ID of the notification to cancel.
+ * Cancels a notification with the specified label and ID.
*
- * @since 7
+ * @param ID of the notification to cancel, which must be unique in the application.
+ * @param Label of the notification to cancel.
*/
function cancel(id: number, label: string, callback: AsyncCallback): void;
function cancel(id: number, label?: string): Promise;
/**
- * Cancels all the published notifications.
- *
- * @since 7
+ * Cancels all notifications of the current application.
*/
function cancelAll(callback: AsyncCallback): void;
function cancelAll(): Promise;
@@ -87,18 +78,23 @@ declare namespace notification {
* This parameter must be specified.
*
* @systemapi Hide this for inner system use.
- * @since 7
*/
function addSlot(slot: NotificationSlot, callback: AsyncCallback): void;
- function addSlot(slot: NotificationSlot): Promise;
/**
* Creates a notification slot.
*
- * @param slot Indicates the notification slot to be created, which is set by {@link SlotType}.
+ * @param slot Indicates the notification slot to be created, which is set by {@link NotificationSlot}.
* This parameter must be specified.
*
- * @since 7
+ * @systemapi Hide this for inner system use.
+ */
+ function addSlot(slot: NotificationSlot): Promise;
+
+ /**
+ * Adds a slot type.
+ *
+ * @param Slot type to add.
*/
function addSlot(type: SlotType, callback: AsyncCallback): void;
function addSlot(type: SlotType): Promise;
@@ -110,66 +106,83 @@ declare namespace notification {
* This parameter must be specified.
*
* @systemapi Hide this for inner system use.
- * @since 7
*/
function addSlots(slots: Array, callback: AsyncCallback): void;
+
+ /**
+ * Creates a notification slot.
+ *
+ * @param slots Indicates the notification slots to be created, which is set by {@link NotificationSlot}.
+ * This parameter must be specified.
+ *
+ * @systemapi Hide this for inner system use.
+ */
function addSlots(slots: Array): Promise;
/**
- * Queries a created notification slot.
+ * Obtains a notification slot of the specified slot type.
*
- * @param slotType Indicates the type of the slot, which is created by
+ * @param Type of the notification slot to obtain.
*
* @return Returns the created {@link NotificationSlot}.
- *
- * @since 7
*/
function getSlot(slotType: SlotType, callback: AsyncCallback): void;
function getSlot(slotType: SlotType): Promise;
/**
- * Obtains all notification slots of this application.
+ * Obtains all NotificationSlot objects created by the current application.
*
* @return Returns all notification slots of this application.
- *
- * @since 7
*/
function getSlots(callback: AsyncCallback>): void;
function getSlots(): Promise>;
/**
- * Deletes a created notification slot based on the slot type.
+ * Removes a NotificationSlot of the specified SlotType created by the current application.
*
- * @param slotType Indicates the type of the slot.
- *
- * @since 7
+ * @param Type of the NotificationSlot to remove.
*/
function removeSlot(slotType: SlotType, callback: AsyncCallback): void;
function removeSlot(slotType: SlotType): Promise;
/**
- * Deletes all notification slots.
- *
- * @since 7
+ * Removes all NotificationSlot objects created by the current application.
*/
function removeAllSlots(callback: AsyncCallback): void;
function removeAllSlots(): Promise;
/**
- * Indicates the type of the slot
- *
- * @since 7
+ * Describes NotificationSlot types.
*/
export enum SlotType {
+ /**
+ * NotificationSlot of an unknown type.
+ */
UNKNOWN_TYPE = 0,
+
+ /**
+ * NotificationSlot for social communication.
+ */
SOCIAL_COMMUNICATION = 1,
+
+ /**
+ * NotificationSlot for service information.
+ */
SERVICE_INFORMATION = 2,
+
+ /**
+ * NotificationSlot for service information.
+ */
CONTENT_INFORMATION = 3,
+
+ /**
+ * NotificationSlot for other purposes.
+ */
OTHER_TYPES = 0xFFFF,
}
/**
- * Indicates the type of the content
+ * Describes notification content types.
*
* @name ContentType
* @since 7
@@ -178,23 +191,63 @@ declare namespace notification {
* @permission N/A
*/
export enum ContentType {
+ /**
+ * Normal text notification.
+ */
NOTIFICATION_CONTENT_BASIC_TEXT,
+
+ /**
+ * Long text notification.
+ */
NOTIFICATION_CONTENT_LONG_TEXT,
+
+ /**
+ * Picture-attached notification.
+ */
NOTIFICATION_CONTENT_PICTURE,
+
+ /**
+ * Conversation notification.
+ */
NOTIFICATION_CONTENT_CONVERSATION,
+
+ /**
+ * Multi-line text notification.
+ */
NOTIFICATION_CONTENT_MULTILINE,
}
/**
* Indicates the level of the slot
- *
- * @since 7
*/
export enum SlotLevel {
+ /**
+ * Indicates that the notification function is disabled.
+ */
LEVEL_NONE = 0,
+
+ /**
+ * Indicates that the notification function is enabled but notification
+ * icons are not displayed in the status bar, with no banner or prompt tone.
+ */
LEVEL_MIN = 1,
+
+ /**
+ * Indicates that the notification function is enabled and notification
+ * icons are displayed in the status bar, with no banner or prompt tone.
+ */
LEVEL_LOW = 2,
+
+ /**
+ * Indicates that the notification function is enabled and notification
+ * icons are displayed in the status bar, with no banner but with a prompt tone.
+ */
LEVEL_DEFAULT = 3,
+
+ /**
+ * Indicates that the notification function is enabled and notification
+ * icons are displayed in the status bar, with a banner and a prompt tone.
+ */
LEVEL_HIGH = 4,
}
@@ -202,119 +255,214 @@ declare namespace notification {
* subscribe
*
* @systemapi Hide this for inner system use.
- * @since 7
+ * @permission ohos.permission.NOTIFICATION_CONTROLLER
*/
function subscribe(subscriber: NotificationSubscriber, callback: AsyncCallback): void;
+
+ /**
+ * subscribe
+ *
+ * @systemapi Hide this for inner system use.
+ * @permission ohos.permission.NOTIFICATION_CONTROLLER
+ */
function subscribe(subscriber: NotificationSubscriber, info: NotificationSubscribeInfo, callback: AsyncCallback): void;
+
+ /**
+ * subscribe
+ *
+ * @systemapi Hide this for inner system use.
+ * @permission ohos.permission.NOTIFICATION_CONTROLLER
+ */
function subscribe(subscriber: NotificationSubscriber, info?: NotificationSubscribeInfo): Promise;
/**
* unsubscribe
*
* @systemapi Hide this for inner system use.
- * @since 7
+ * @permission ohos.permission.NOTIFICATION_CONTROLLER
*/
function unsubscribe(subscriber: NotificationSubscriber, callback: AsyncCallback): void;
+
+ /**
+ * unsubscribe
+ *
+ * @systemapi Hide this for inner system use.
+ * @permission ohos.permission.NOTIFICATION_CONTROLLER
+ */
function unsubscribe(subscriber: NotificationSubscriber): Promise;
/**
* enableNotification
*
* @systemapi Hide this for inner system use.
- * @since 7
+ * @permission ohos.permission.NOTIFICATION_CONTROLLER
*/
function enableNotification(bundle: BundleOption, enable: boolean, callback: AsyncCallback): void;
+
+ /**
+ * enableNotification
+ *
+ * @systemapi Hide this for inner system use.
+ * @permission ohos.permission.NOTIFICATION_CONTROLLER
+ */
function enableNotification(bundle: BundleOption, enable: boolean): Promise;
/**
* isNotificationEnabled
*
* @systemapi Hide this for inner system use.
- * @since 7
*/
function isNotificationEnabled(bundle: BundleOption, callback: AsyncCallback): void;
+
+ /**
+ * isNotificationEnabled
+ *
+ * @systemapi Hide this for inner system use.
+ */
function isNotificationEnabled(bundle: BundleOption): Promise;
/**
* isNotificationEnabled
*
* @systemapi Hide this for inner system use.
- * @since 7
*/
function isNotificationEnabled(callback: AsyncCallback): void;
+
+ /**
+ * isNotificationEnabled
+ *
+ * @systemapi Hide this for inner system use.
+ */
function isNotificationEnabled(): Promise;
/**
* displayBadge
*
* @systemapi Hide this for inner system use.
- * @since 7
*/
function displayBadge(bundle: BundleOption, enable: boolean, callback: AsyncCallback): void;
+
+ /**
+ * displayBadge
+ *
+ * @systemapi Hide this for inner system use.
+ */
function displayBadge(bundle: BundleOption, enable: boolean): Promise;
/**
* isBadgeDisplayed
*
* @systemapi Hide this for inner system use.
- * @since 7
*/
function isBadgeDisplayed(bundle: BundleOption, callback: AsyncCallback): void;
+
+ /**
+ * isBadgeDisplayed
+ *
+ * @systemapi Hide this for inner system use.
+ */
function isBadgeDisplayed(bundle: BundleOption): Promise;
/**
* setSlotByBundle
*
* @systemapi Hide this for inner system use.
- * @since 7
+ * @permission ohos.permission.NOTIFICATION_CONTROLLER
*/
function setSlotByBundle(bundle: BundleOption, slot: NotificationSlot, callback: AsyncCallback): void;
+
+ /**
+ * setSlotByBundle
+ *
+ * @systemapi Hide this for inner system use.
+ * @permission ohos.permission.NOTIFICATION_CONTROLLER
+ */
function setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise;
/**
* getSlotsByBundle
*
* @systemapi Hide this for inner system use.
- * @since 7
+ * @permission ohos.permission.NOTIFICATION_CONTROLLER
*/
function getSlotsByBundle(bundle: BundleOption, callback: AsyncCallback>): void;
+
+ /**
+ * getSlotsByBundle
+ *
+ * @systemapi Hide this for inner system use.
+ * @permission ohos.permission.NOTIFICATION_CONTROLLER
+ */
function getSlotsByBundle(bundle: BundleOption): Promise>;
/**
* getSlotNumByBundle
*
* @systemapi Hide this for inner system use.
- * @since 7
*/
function getSlotNumByBundle(bundle: BundleOption, callback: AsyncCallback): void;
+
+ /**
+ * getSlotNumByBundle
+ *
+ * @systemapi Hide this for inner system use.
+ */
function getSlotNumByBundle(bundle: BundleOption): Promise;
/**
* remove
*
* @systemapi Hide this for inner system use.
- * @since 7
+ * @permission ohos.permission.NOTIFICATION_CONTROLLER
*/
function remove(bundle: BundleOption, notificationKey: NotificationKey, callback: AsyncCallback): void;
+
+ /**
+ * remove
+ *
+ * @systemapi Hide this for inner system use.
+ * @permission ohos.permission.NOTIFICATION_CONTROLLER
+ */
function remove(bundle: BundleOption, notificationKey: NotificationKey): Promise;
/**
* remove
*
* @systemapi Hide this for inner system use.
- * @since 7
+ * @permission ohos.permission.NOTIFICATION_CONTROLLER
*/
function remove(hashCode: string, callback: AsyncCallback): void;
+
+ /**
+ * remove
+ *
+ * @systemapi Hide this for inner system use.
+ * @permission ohos.permission.NOTIFICATION_CONTROLLER
+ */
function remove(hashCode: string): Promise;
/**
* removeAll
*
* @systemapi Hide this for inner system use.
- * @since 7
+ * @permission ohos.permission.NOTIFICATION_CONTROLLER
*/
function removeAll(bundle: BundleOption, callback: AsyncCallback): void;
+
+ /**
+ * removeAll
+ *
+ * @systemapi Hide this for inner system use.
+ * @permission ohos.permission.NOTIFICATION_CONTROLLER
+ */
function removeAll(callback: AsyncCallback): void;
+
+ /**
+ * removeAll
+ *
+ * @systemapi Hide this for inner system use.
+ * @permission ohos.permission.NOTIFICATION_CONTROLLER
+ */
function removeAll(bundle?: BundleOption): Promise;
/**
@@ -322,31 +470,33 @@ declare namespace notification {
* call this method.
*
* @systemapi Hide this for inner system use.
- * @since 7
+ * @permission ohos.permission.NOTIFICATION_CONTROLLER
*/
function getAllActiveNotifications(callback: AsyncCallback>): void;
- function getAllActiveNotifications(): Promise>;
/**
- * Obtains the number of active notifications of the current application in the system.
+ * Obtains all active notifications in the current system. The caller must have system permissions to
+ * call this method.
*
- * @since 7
+ * @systemapi Hide this for inner system use.
+ * @permission ohos.permission.NOTIFICATION_CONTROLLER
+ */
+ function getAllActiveNotifications(): Promise>;
+
+ /**
+ * Obtains the number of all active notifications.
*/
function getActiveNotificationCount(callback: AsyncCallback): void;
function getActiveNotificationCount(): Promise;
/**
- * Obtains active notifications of the current application in the system.
- *
- * @since 7
+ * Obtains an array of active notifications.
*/
function getActiveNotifications(callback: AsyncCallback>): void;
function getActiveNotifications(): Promise>;
/**
- * BundleOption
- *
- * @since 7
+ * Describes a BundleOption.
*/
export interface BundleOption {
bundle: string;
@@ -354,9 +504,7 @@ declare namespace notification {
}
/**
- * NotificationKey
- *
- * @since 7
+ * Describes a NotificationKey, which can be used to identify a notification.
*/
export interface NotificationKey {
id: number;
@@ -367,7 +515,6 @@ declare namespace notification {
* DisturbMode
*
* @systemapi Hide this for inner system use.
- * @since 7
*/
export enum DoNotDisturbMode {
ALLOW_UNKNOWN,
diff --git a/api/@ohos.wantAgent.d.ts b/api/@ohos.wantAgent.d.ts
index f7eab8a04f132e0681e147a410e316dde067d16f..17dd1c8aa2d855ada9d3e36a8b994b45eb4ca9e5 100644
--- a/api/@ohos.wantAgent.d.ts
+++ b/api/@ohos.wantAgent.d.ts
@@ -25,26 +25,24 @@ import { TriggerInfo } from './wantAgent/triggerInfo';
* @name wantAgent
* @since 7
* @devices phone, tablet, tv, wearable, car
- * @import wantAgent from '@ohos.wantAgent';
+ * @import import wantAgent from '@ohos.wantAgent';
* @permission N/A
*/
declare namespace wantAgent {
/**
- * Obtains the bundle name of an {@link WantAgent}.
+ * Obtains the bundle name of a WantAgent.
*
- * @param agent Indicates the {@link WantAgent} whose bundle name is to be obtained.
+ * @param WantAgent whose bundle name to obtain.
* @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}.
+ * Obtains the UID of a WantAgent.
*
- * @param agent Indicates the {@link WantAgent} whose UID is to be obtained.
+ * @param WantAgent whose UID to obtain.
* @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;
@@ -55,98 +53,177 @@ declare namespace 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;
+
+ /**
+ * Obtains the {@link Want} of an {@link WantAgent}.
+ *
+ * @param agent Indicates the {@link WantAgent} whose UID is to be obtained.
+ * @return Returns the {@link Want} of the {@link WantAgent}.
+ * @systemapi Hide this for inner system use.
+ */
function getWant(agent: WantAgent): Promise;
/**
- * Cancels an {@link WantAgent}. Only the application that creates the {@link IntentAgent} can cancel it.
+ * Cancels a WantAgent. Only the application that creates the WantAgent can cancel it.
*
- * @param agent Indicates the {@link WantAgent} to cancel.
- * @since 7
+ * @param WantAgent to cancel.
*/
function cancel(agent: WantAgent, callback: AsyncCallback): void;
function cancel(agent: WantAgent): Promise;
/**
- * Obtains the bundle name of an {@link WantAgent}.
+ * Triggers a 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 WantAgent to trigger.
+ * @param Trigger 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.
+ * Checks whether two WantAgent objects are equal.
*
- * @param agent Indicates one of the {@link WantAgent} object to compare.
- * @param otherAgent Indicates the other {@link WantAgent} object to compare.
+ * @param WantAgent to compare.
+ * @param WantAgent 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.
+ * Obtains a WantAgent object.
*
- * @param info Indicates the {@link WantAgentInfo} object that contains parameters of the
- * {@link WantAgent} object to create.
+ * @param Information about the WantAgent object to obtain.
* @return Returns the created {@link WantAgent} object.
- * @since 7
*/
function getWantAgent(info: WantAgentInfo, callback: AsyncCallback): void;
function getWantAgent(info: WantAgentInfo): Promise;
/**
- * Enumerates flags for using an {@link WantAgent}.
- *
- * @since 7
+ * Enumerates flags for using a WantAgent.
*/
export enum WantAgentFlags {
+ /**
+ * Indicates that the WantAgent can be used only once.
+ * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT.
+ */
ONE_TIME_FLAG = 0,
+
+ /**
+ * Indicates that null is returned if the WantAgent does not exist.
+ * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT.
+ */
NO_BUILD_FLAG,
+
+ /**
+ * Indicates that the existing WantAgent should be canceled before a new object is generated.
+ * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT.
+ */
CANCEL_PRESENT_FLAG,
+
+ /**
+ * Indicates that the system only replaces the extra data of the existing WantAgent with that of the new object.
+ * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT.
+ */
UPDATE_PRESENT_FLAG,
+
+ /**
+ * Indicates that the created WantAgent should be immutable.
+ */
CONSTANT_FLAG,
+
+ /**
+ * Indicates that the current value of element can be replaced when the WantAgent is triggered.
+ */
REPLACE_ELEMENT,
+
+ /**
+ * Indicates that the current value of action can be replaced when the WantAgent is triggered.
+ */
REPLACE_ACTION,
+
+ /**
+ * Indicates that the current value of uri can be replaced when the WantAgent is triggered.
+ */
REPLACE_URI,
+
+ /**
+ * Indicates that the current value of entities can be replaced when the WantAgent is triggered.
+ */
REPLACE_ENTITIES,
+
+ /**
+ * Indicates that the current value of packageName can be replaced when the WantAgent is triggered.
+ */
REPLACE_BUNDLE
}
/**
- * Identifies the operation for using an {@link WantAgent}, such as starting an ability or sending a common event.
- *
- * @since 7
+ * Identifies the operation for using a WantAgent, such as starting an ability or sending a common event.
*/
export enum OperationType {
+ /**
+ * Unknown operation.
+ */
UNKNOWN_TYPE = 0,
+
+ /**
+ * Starts an ability with a UI.
+ */
START_ABILITY,
+
+ /**
+ * Starts multiple abilities with a UI.
+ */
START_ABILITIES,
+
+ /**
+ * Starts an ability without a UI.
+ */
START_SERVICE,
+
+ /**
+ * Sends a common event.
+ */
SEND_COMMON_EVENT
}
/**
- * A callback for the {@link trigger()} method. After the method execution is complete,
- * the callback process will start.
- *
- * @since 7
+ * Describes the data returned by after wantAgent.trigger is called.
*/
export interface CompleteData {
+ /**
+ * Triggered WantAgent.
+ */
info: WantAgent;
+
+ /**
+ * Existing Want that is triggered.
+ */
want: Want;
+
+ /**
+ * Request code used to trigger the WantAgent.
+ */
finalCode: number;
+
+ /**
+ * Final data collected by the common event.
+ */
finalData: string;
+
+ /**
+ * Extra data collected by the common event.
+ */
extraInfo?: {[key: string]: any};
}
}
+/**
+ * WantAgent object.
+ */
export type WantAgent = object;
export default wantAgent;
\ No newline at end of file
diff --git a/api/notification/notificationActionButton.ts b/api/notification/notificationActionButton.d.ts
similarity index 83%
rename from api/notification/notificationActionButton.ts
rename to api/notification/notificationActionButton.d.ts
index 140215050e83fcd221ae81a436d28b747f233353..39cc3db49ea37fe7a708c51f36b0854e14ce90a9 100644
--- a/api/notification/notificationActionButton.ts
+++ b/api/notification/notificationActionButton.d.ts
@@ -16,15 +16,26 @@
import { WantAgent } from '../@ohos.wantAgent';
/**
- * The action button of notification
+ * Describes an action button displayed in a notification.
* @name NotificationActionButton
* @since 7
- * @sysCap SystemCapability.Notification.ANS
* @devices phone, tablet, tv, wearable, car
* @permission N/A
+ * @sysCap SystemCapability.Notification.ANS
*/
export interface NotificationActionButton {
+ /**
+ * Button title.
+ */
title: string;
+
+ /**
+ * WantAgent of the button.
+ */
wantAgent: WantAgent;
+
+ /**
+ * Extra information of the button.
+ */
extras?: {[key: string]: any};
}
diff --git a/api/notification/notificationContent.d.ts b/api/notification/notificationContent.d.ts
index 7624cd304a6e7b08d1852f62296c449a32597e3e..d2cc36ebdc6e98670dfc6dc78c3071da0564e4f5 100644
--- a/api/notification/notificationContent.d.ts
+++ b/api/notification/notificationContent.d.ts
@@ -15,9 +15,8 @@
import notification from '../@ohos.notification';
import image from './@ohos.multimedia.image';
-
/**
- * Constructs basic notifications.
+ * Describes a normal text notification.
*
* @name NotificationBasicContent
* @since 7
@@ -26,13 +25,24 @@ import image from './@ohos.multimedia.image';
* @permission N/A
*/
export interface NotificationBasicContent {
+ /**
+ * Title of the normal text notification.
+ */
title: string;
+
+ /**
+ * Content of the normal text notification.
+ */
text: string;
+
+ /**
+ * Additional information of the normal text notification.
+ */
additionalText?: string;
}
/**
- * Constructs notifications that include long text. The long text contains a maximum of 1024 characters.
+ * Describes a long text notification.
*
* @name NotificationLongTextContent
* @since 7
@@ -41,13 +51,24 @@ export interface NotificationBasicContent {
* @permission N/A
*/
export interface NotificationLongTextContent extends NotificationBasicContent {
+ /**
+ * Long text content of the notification.
+ */
longText: string;
+
+ /**
+ * Brief text of the long text notification.
+ */
briefText: string;
+
+ /**
+ * Title that will be displayed for the long text notification when it is expanded.
+ */
expandedTitle: string;
}
/**
- * Constructs a notification that includes multiple lines of text.
+ * Describes a multi-line text notification.
*
* @name NotificationMultiLineContent
* @since 7
@@ -56,13 +77,24 @@ export interface NotificationLongTextContent extends NotificationBasicContent {
* @permission N/A
*/
export interface NotificationMultiLineContent extends NotificationBasicContent {
+ /**
+ * Brief text of the multi-line text notification.
+ */
briefText: string;
+
+ /**
+ * Brief text of the multi-line text notification.
+ */
longTitle: string;
+
+ /**
+ * Multi-line content of the multi-line text notification.
+ */
lines: Array;
}
/**
- * Constructs a notification that includes a picture.
+ * Describes a picture-attached notification.
*
* @name NotificationPictureContent
* @since 7
@@ -71,13 +103,24 @@ export interface NotificationMultiLineContent extends NotificationBasicContent {
* @permission N/A
*/
export interface NotificationPictureContent extends NotificationBasicContent {
+ /**
+ * Multi-line content of the multi-line text notification.
+ */
briefText: string;
+
+ /**
+ * Title that will be displayed for the picture-attached notification when it is expanded.
+ */
expandedTitle: string;
+
+ /**
+ * Picture to be included in a notification.
+ */
picture: image.PixelMap;
}
/**
- * Constructs a notification.
+ * Describes notification types.
*
* @name NotificationContent
* @since 7
@@ -86,9 +129,28 @@ export interface NotificationPictureContent extends NotificationBasicContent {
* @permission N/A
*/
export interface NotificationContent {
+ /**
+ * Notification content type.
+ */
contentType: notification.ContentType;
+
+ /**
+ * Normal text notification.
+ */
normal?: NotificationBasicContent;
+
+ /**
+ * Long text notification.
+ */
longText?: NotificationLongTextContent;
+
+ /**
+ * Multi-line text notification.
+ */
multiLine?: NotificationMultiLineContent;
+
+ /**
+ * Picture-attached notification.
+ */
picture?: NotificationPictureContent;
}
diff --git a/api/notification/notificationRequest.d.ts b/api/notification/notificationRequest.d.ts
index f3e2657fe0b4ed4e0a8d7162e568f16c6b2c0c46..b7e6575057d9b8eaf3e11c0bf7ab21d13628bf5f 100644
--- a/api/notification/notificationRequest.d.ts
+++ b/api/notification/notificationRequest.d.ts
@@ -20,7 +20,7 @@ import { NotificationContent } from './notificationContent';
import { NotificationActionButton } from './notificationActionButton';
/**
- * Carries notifications.
+ * Defines a NotificationRequest instance.
*
* @name NotificationRequest
* @since 7
@@ -29,44 +29,140 @@ import { NotificationActionButton } from './notificationActionButton';
* @permission N/A
*/
export interface NotificationRequest {
+ /**
+ * Notification content.
+ */
content: NotificationContent;
+
+ /**
+ * Notification ID.
+ */
id?: number;
+
+ /**
+ * Notification slot type.
+ */
slotType?: notification.SlotType;
+
+ /**
+ * Whether the notification is an ongoing notification.
+ */
isOngoing?: boolean;
+
+ /**
+ * Whether the notification can be removed.
+ */
isUnremovable?: boolean;
+
+ /**
+ * Time when the notification is sent.
+ */
deliveryTime?: number;
+
+ /**
+ * Whether the notification is automatically cleared.
+ */
tapDismissed?: boolean;
+
+ /**
+ * Time when the notification is automatically cleared.
+ */
autoDeletedTime?: number;
+
+ /**
+ * WantAgent instance to which the notification will be redirected after being clicked.
+ */
wantAgent?: WantAgent;
+
+ /**
+ * Extended parameter.
+ */
extraInfo?: {[key: string]: any};
+
+ /**
+ * Background color of the notification.
+ */
color?: number;
+
+ /**
+ * Whether the notification background color can be enabled.
+ */
colorEnabled?: boolean;
+
+ /**
+ * Whether the notification triggers an alert only once.
+ */
isAlertOnce?: boolean;
+
+ /**
+ * Whether to display the stopwatch.
+ */
isStopwatch?: boolean;
+
+ /**
+ * Whether to display the countdown time.
+ */
isCountDown?: boolean;
+
+ /**
+ * Whether the notification is displayed as a floating icon.
+ */
isFloatingIcon?: boolean;
+
+ /**
+ * Notification label.
+ */
label?: string;
+
+ /**
+ * Notification badge type.
+ */
badgeIconStyle?: number;
+
+ /**
+ * Whether to display the time when the notification is delivered.
+ */
showDeliveryTime?: boolean;
+
+ /**
+ * Buttons in the notification. Up to two buttons are allowed.
+ */
actionButtons?: Array;
+
+ /**
+ * Small notification icon.
+ */
smallIcon?: image.PixelMap;
+
+ /**
+ * Large notification icon.
+ */
largeIcon?: image.PixelMap;
+
+ /**
+ * Read-only name of the package for which a notification is created.
+ */
readonly creatorBundleName?: string;
+
+ /**
+ * Read-only UID of the notification creator.
+ */
readonly creatorUid?: number;
+
+ /**
+ * Read-only PID of the notification creator.
+ */
readonly creatorPid?: number;
/**
* Obtains the classification of this notification.
*
* @systemapi Hide this for inner system use.
- * @since 7
*/
classification?: string;
/**
* Obtains the unique hash code of a notification in the current application.
- *
- * @since 7
*/
readonly hashCode?: string;
}
diff --git a/api/notification/notificationSlot.d.ts b/api/notification/notificationSlot.d.ts
index 56f987e69eecab5a125c9ba077f6c5d27153ba18..82ff360f74f57ce33f6749c346ba2e29f15019eb 100644
--- a/api/notification/notificationSlot.d.ts
+++ b/api/notification/notificationSlot.d.ts
@@ -16,89 +16,67 @@
import notification from '../@ohos.notification';
/**
- * A constructor used to initialize the type, desc, and level of a {@code NotificationSlot} object.
+ * Describes a NotificationSlot instance.
*
* @name NotificationSlot
* @since 7
- * @sysCap SystemCapability.Notification.ANS
* @devices phone, tablet, tv, wearable, car
* @permission N/A
+ * @sysCap SystemCapability.Notification.ANS
*/
export interface NotificationSlot {
/**
* Obtains the type of a notification slot.
- *
- * @since 7
*/
type: notification.SlotType;
/**
* Obtains the level of a notification slot
- *
- * @since 7
*/
level?: notification.SlotLevel;
/**
* Obtains the description of a notification slot.
- *
- * @since 7
*/
desc?: string;
/**
* Obtains the application icon badge status of a notification slot.
- *
- * @since 7
*/
badgeFlag?: boolean;
/**
* Obtains whether DND mode is bypassed for a notification slot.
- *
- * @since 7
*/
bypassDnd?: boolean;
/**
* Whether and how to display notifications on the lock screen.
- *
- * @since 7
*/
lockscreenVisibility?: number;
/**
* Obtains the vibration status of the notification slot.
- *
- * @since 7
*/
vibrationEnabled?: boolean;
/**
* Obtains the prompt tone of the notification slot.
- *
- * @since 7
*/
sound?: string;
/**
* Obtains whether the notification light is enabled in a notification slot.
- *
- * @since 7
*/
lightEnabled?: boolean;
/**
* Obtains the color of the notification light in a notification slot.
- *
- * @since 7
*/
lightColor?: number;
/**
* Obtains the vibration style of notifications in this notification slot.
- *
- * @since 7
*/
vibrationValues?: Array;
}
diff --git a/api/notification/notificationSubscribeInfo.ts b/api/notification/notificationSubscribeInfo.d.ts
similarity index 100%
rename from api/notification/notificationSubscribeInfo.ts
rename to api/notification/notificationSubscribeInfo.d.ts
diff --git a/api/wantAgent/triggerInfo.d.ts b/api/wantAgent/triggerInfo.d.ts
index 20dfdeab1fc8bd7d13e886209198ea49f4e91f14..8cd951dce9dd5e01050781527b93b30a26b1c32f 100644
--- a/api/wantAgent/triggerInfo.d.ts
+++ b/api/wantAgent/triggerInfo.d.ts
@@ -16,7 +16,7 @@
import { Want } from '../ability/want';
/**
- * the info when object of WantAgent trigger
+ * Provides the information required for triggering a WantAgent.
*
* @name TriggerInfo
* @since 7
@@ -24,8 +24,30 @@ import { Want } from '../ability/want';
* @permission N/A
*/
export interface TriggerInfo {
+ /**
+ * Result code.
+ */
code: number;
+
+ /**
+ * Extra Want.
+ * If flags in WantAgentInfo contain CONSTANT_FLAG, this parameter is invalid.
+ * If flags contain REPLACE_ELEMENT, REPLACE_ACTION, REPLACE_URI, REPLACE_ENTITIES, and REPLACE_BUNDLE,
+ * the element, action, uri, entities, and bundleName attributes of the Want specified in this parameter
+ * will be used to replace the corresponding attributes in the original Want, respectively.
+ * If this parameter is null, the original Want remains unchanged.
+ */
want?: Want;
+
+ /**
+ * Permission required for a WantAgent recipient.
+ * This parameter is valid only when the WantAgent is triggered to send common events.
+ * If permission is null, no permission is required on the recipient.
+ */
permission?: string;
+
+ /**
+ * Custom extra data you want to add for triggering a WantAgent.
+ */
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 d4d1c8705268dabffb6e72240f02633426371da3..f33531d327fef0445af7e2609cd3fb924ded1971 100644
--- a/api/wantAgent/wantAgentInfo.d.ts
+++ b/api/wantAgent/wantAgentInfo.d.ts
@@ -17,7 +17,7 @@ import { Want } from '../ability/want';
import wantAgent from '../@ohos.wantAgent'
/**
- * the info of WantAgent
+ * Provides the information required for triggering a WantAgent.
*
* @name WantAgentInfo
* @since 7
@@ -25,9 +25,29 @@ import wantAgent from '../@ohos.wantAgent'
* @permission N/A
*/
export interface WantAgentInfo {
+ /**
+ * An array of all Wants for starting abilities or sending common events. Only Wants can be displayed.
+ */
wants: Array;
+
+ /**
+ * Type of the action specified in a Want.
+ */
operationType: wantAgent.OperationType;
+
+ /**
+ * Request code defined by the user.
+ */
requestCode: number;
+
+ /**
+ * An array of flags for using the WantAgent.
+ */
wantAgentFlags?: Array;
+
+ /**
+ * Extra information about how the Want starts an ability.
+ * If there is no extra information to set, this constant can be left empty.
+ */
extraInfo?: {[key: string]: any};
}
\ No newline at end of file