Signed-off-by: zero-cyc <chenlien@huawei.com>
Change-Id: Id964820bc7be103608ea963bbe346c2d039dcee7
This commit is contained in:
zero-cyc 2022-02-11 13:31:07 +08:00
parent 8f0c129128
commit 583695b928
17 changed files with 60 additions and 76 deletions

View File

@ -22,6 +22,7 @@ import { CommonEventPublishData } from './commonEvent/commonEventPublishData';
* the defination for commonevent
* @name commonEvent
* @since 7
* @syscap SystemCapability.Notification.CommonEvent
* @permission N/A
*/
declare namespace commonEvent {
@ -29,7 +30,7 @@ declare namespace commonEvent {
* Publishes an ordered, sticky, or standard common event.
*
* @since 7
* @param data Indicate the CommonEventPublishData containing the common event content and attributes.
* @param event name of the common event.
* @param callback Specified callback method.
* @return -
*/
@ -39,7 +40,8 @@ declare namespace commonEvent {
* Publishes an ordered, sticky, or standard common event.
*
* @since 7
* @param data Indicate the CommonEventPublishData containing the common event content and attributes.
* @param event name of the common event.
* @param options Indicate the CommonEventPublishData containing the common event content and attributes.
* @param callback Specified callback method.
* @return -
*/
@ -60,8 +62,7 @@ declare namespace commonEvent {
*
* @since 7
* @param subscribeInfo Indicate the information of the subscriber.
* @param callback Specified callback method.
* @return -
* @return Returns common event subscriber object
*/
function createSubscriber(subscribeInfo: CommonEventSubscribeInfo): Promise<CommonEventSubscriber>;

View File

@ -19,6 +19,7 @@ import { Callback } from './basic';
* Provides methods for sending and processing in-process events.
*
* @since 7
* @syscap SystemCapability.Notification.Emitter
* @import import events_emitter from '@ohos.emitter';
* @permission N/A
*/

View File

@ -32,8 +32,7 @@ import { NotificationRequest } from './notification/notificationRequest';
*
* @name notification
* @since 7
* @sysCap SystemCapability.Notification.ANS
* @devices phone, tablet, tv, wearable, car
* @syscap SystemCapability.Notification.Notification
* @import import notification from '@ohos.notification';
* @permission N/A
*/
@ -44,7 +43,8 @@ declare namespace notification {
* <p>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 Publishes a notification.
* @param request notification request
* @param callback callback function
*/
function publish(request: NotificationRequest, callback: AsyncCallback<void>): void;
function publish(request: NotificationRequest): Promise<void>;
@ -52,15 +52,17 @@ declare namespace notification {
/**
* Cancels a notification with the specified ID.
*
* @param ID of the notification to cancel, which must be unique in the application.
* @param id of the notification to cancel, which must be unique in the application.
* @param callback callback function
*/
function cancel(id: number, callback: AsyncCallback<void>): void;
/**
* Cancels a notification with the specified label and ID.
*
* @param ID of the notification to cancel, which must be unique in the application.
* @param Label of the notification to cancel.
* @param id ID of the notification to cancel, which must be unique in the application.
* @param label Label of the notification to cancel.
* @param callback callback function
*/
function cancel(id: number, label: string, callback: AsyncCallback<void>): void;
function cancel(id: number, label?: string): Promise<void>;
@ -76,7 +78,7 @@ declare namespace notification {
*
* @param slot Indicates the notification slot to be created, which is set by {@link NotificationSlot}.
* This parameter must be specified.
*
* @param callback callback function
* @systemapi Hide this for inner system use.
*/
function addSlot(slot: NotificationSlot, callback: AsyncCallback<void>): void;
@ -94,7 +96,8 @@ declare namespace notification {
/**
* Adds a slot type.
*
* @param Slot type to add.
* @param type Slot type to add.
* @param callback callback function
*/
function addSlot(type: SlotType, callback: AsyncCallback<void>): void;
function addSlot(type: SlotType): Promise<void>;
@ -104,7 +107,7 @@ declare namespace notification {
*
* @param slots Indicates the notification slots to be created, which is set by {@link NotificationSlot}.
* This parameter must be specified.
*
* @param callback callback function
* @systemapi Hide this for inner system use.
*/
function addSlots(slots: Array<NotificationSlot>, callback: AsyncCallback<void>): void;
@ -122,8 +125,8 @@ declare namespace notification {
/**
* Obtains a notification slot of the specified slot type.
*
* @param Type of the notification slot to obtain.
*
* @param slotType Type of the notification slot to obtain.
* @param callback callback function
* @return Returns the created {@link NotificationSlot}.
*/
function getSlot(slotType: SlotType, callback: AsyncCallback<NotificationSlot>): void;
@ -140,7 +143,8 @@ declare namespace notification {
/**
* Removes a NotificationSlot of the specified SlotType created by the current application.
*
* @param Type of the NotificationSlot to remove.
* @param slotType Type of the NotificationSlot to remove.
* @param callback callback function
*/
function removeSlot(slotType: SlotType, callback: AsyncCallback<void>): void;
function removeSlot(slotType: SlotType): Promise<void>;
@ -186,8 +190,7 @@ declare namespace notification {
*
* @name ContentType
* @since 7
* @sysCap SystemCapability.Notification.ANS
* @devices phone, tablet, tv, wearable, car
* @syscap SystemCapability.Notification.Notification
* @permission N/A
*/
export enum ContentType {

View File

@ -16,6 +16,7 @@
/**
* the data of the commonEvent
* @name CommonEventData
* @syscap SystemCapability.Notification.commonEvent
* @since 7
* @permission N/A
*/

View File

@ -17,6 +17,7 @@
* containing the common event content and attributes
* @name CommonEventPublishData
* @since 7
* @syscap SystemCapability.Notification.commonEvent
* @permission N/A
*/
export interface CommonEventPublishData {

View File

@ -17,6 +17,7 @@
* the information of the subscriber
* @name CommonEventSubscribeInfo
* @since 7
* @syscap SystemCapability.Notification.commonEvent
* @permission N/A
*/
export interface CommonEventSubscribeInfo {

View File

@ -19,6 +19,7 @@ import { CommonEventSubscribeInfo } from './commonEventSubscribeInfo';
* the subscriber of common event
* @name CommonEventSubscriber
* @since 7
* @syscap SystemCapability.Notification.commonEvent
* @permission N/A
*/
export interface CommonEventSubscriber {
@ -26,7 +27,7 @@ export interface CommonEventSubscriber {
* Obtains the result code of the current ordered common event.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @param callback Indicate the callback function to receive the common event.
* @return -
*/
getCode(callback: AsyncCallback<number>): void;
@ -35,8 +36,7 @@ export interface CommonEventSubscriber {
* Obtains the result code of the current ordered common event.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
* @return Returns code of this common event
*/
getCode(): Promise<number>;
@ -45,7 +45,7 @@ export interface CommonEventSubscriber {
*
* @since 7
* @param code Indicates the custom result code to set. You can set it to any value.
* @param callback Indicate the callback funtion to receive the common event.
* @param callback Indicate the callback function to receive the common event.
* @return -
*/
setCode(code: number, callback: AsyncCallback<void>): void;
@ -55,7 +55,6 @@ export interface CommonEventSubscriber {
*
* @since 7
* @param code Indicates the custom result code to set. You can set it to any value.
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
setCode(code: number): Promise<void>;
@ -64,7 +63,7 @@ export interface CommonEventSubscriber {
* Obtains the result data of the current ordered common event.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @param callback Indicate the callback function to receive the common event.
* @return -
*/
getData(callback: AsyncCallback<string>): void;
@ -73,8 +72,8 @@ export interface CommonEventSubscriber {
* Obtains the result data of the current ordered common event.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
* @return
* @return Returns data of this common event
*/
getData(): Promise<string>;
@ -83,7 +82,7 @@ export interface CommonEventSubscriber {
*
* @since 7
* @param data Indicates the custom result data to set. You can set it to any character string.
* @param callback Indicate the callback funtion to receive the common event.
* @param callback Indicate the callback function to receive the common event.
* @return -
*/
setData(data: string, callback: AsyncCallback<void>): void;
@ -93,7 +92,6 @@ export interface CommonEventSubscriber {
*
* @since 7
* @param data Indicates the custom result data to set. You can set it to any character string.
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
setData(data: string): Promise<void>;
@ -104,7 +102,7 @@ export interface CommonEventSubscriber {
* @since 7
* @param code Indicates the custom result code to set. You can set it to any value.
* @param data Indicates the custom result data to set. You can set it to any character string.
* @param callback Indicate the callback funtion to receive the common event.
* @param callback Indicate the callback function to receive the common event.
* @return -
*/
setCodeAndData(code: number, data: string, callback: AsyncCallback<void>): void;
@ -115,7 +113,6 @@ export interface CommonEventSubscriber {
* @since 7
* @param code Indicates the custom result code to set. You can set it to any value.
* @param data Indicates the custom result data to set. You can set it to any character string.
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
setCodeAndData(code: number, data: string): Promise<void>;
@ -124,7 +121,7 @@ export interface CommonEventSubscriber {
* Checks whether the current common event is an ordered common event.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @param callback Indicate the callback function to receive the common event.
* @return -
*/
isOrderedCommonEvent(callback: AsyncCallback<boolean>): void;
@ -133,8 +130,7 @@ export interface CommonEventSubscriber {
* Checks whether the current common event is an ordered common event.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
* @return Returns true if this common event is ordered, false otherwise
*/
isOrderedCommonEvent(): Promise<boolean>;
@ -142,7 +138,7 @@ export interface CommonEventSubscriber {
* Checks whether the current common event is a sticky common event.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @param callback Indicate the callback function to receive the common event.
* @return -
*/
isStickyCommonEvent(callback: AsyncCallback<boolean>): void;
@ -151,8 +147,7 @@ export interface CommonEventSubscriber {
* Checks whether the current common event is a sticky common event.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
* @return Returns true if this common event is sticky, false otherwise
*/
isStickyCommonEvent(): Promise<boolean>;
@ -160,7 +155,7 @@ export interface CommonEventSubscriber {
* Aborts the current ordered common event.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @param callback Indicate the callback function to receive the common event.
* @return -
*/
abortCommonEvent(callback: AsyncCallback<void>): void;
@ -169,7 +164,6 @@ export interface CommonEventSubscriber {
* Aborts the current ordered common event.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
abortCommonEvent(): Promise<void>;
@ -178,7 +172,7 @@ export interface CommonEventSubscriber {
* Clears the abort state of the current ordered common event
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @param callback Indicate the callback function to receive the common event.
* @return -
*/
clearAbortCommonEvent(callback: AsyncCallback<void>): void;
@ -187,7 +181,6 @@ export interface CommonEventSubscriber {
* Clears the abort state of the current ordered common event
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
*/
clearAbortCommonEvent(): Promise<void>;
@ -196,7 +189,7 @@ export interface CommonEventSubscriber {
* Checks whether the current ordered common event should be aborted.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @param callback Indicate the callback function to receive the common event.
* @return -
*/
getAbortCommonEvent(callback: AsyncCallback<boolean>): void;
@ -205,8 +198,7 @@ export interface CommonEventSubscriber {
* Checks whether the current ordered common event should be aborted.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
* @return Returns true if this common event is aborted, false otherwise
*/
getAbortCommonEvent(): Promise<boolean>;
@ -214,7 +206,7 @@ export interface CommonEventSubscriber {
* get the CommonEventSubscribeInfo of this CommonEventSubscriber.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @param callback Indicate the callback function to receive the common event.
* @return -
*/
getSubscribeInfo(callback: AsyncCallback<CommonEventSubscribeInfo>): void;
@ -223,8 +215,7 @@ export interface CommonEventSubscriber {
* get the CommonEventSubscribeInfo of this CommonEventSubscriber.
*
* @since 7
* @param callback Indicate the callback funtion to receive the common event.
* @return -
* @return Returns the commonEvent subscribe information
*/
getSubscribeInfo(): Promise<CommonEventSubscribeInfo>;
}

View File

@ -20,9 +20,8 @@ import { WantAgent } from '../@ohos.wantAgent';
* Describes an action button displayed in a notification.
* @name NotificationActionButton
* @since 7
* @devices phone, tablet, tv, wearable, car
* @permission N/A
* @sysCap SystemCapability.Notification.ANS
* @syscap SystemCapability.Notification.Notification
*/
export interface NotificationActionButton {
/**

View File

@ -20,8 +20,7 @@ import image from './@ohos.multimedia.image';
*
* @name NotificationBasicContent
* @since 7
* @sysCap SystemCapability.Notification.ANS
* @devices phone, tablet, tv, wearable, car
* @syscap SystemCapability.Notification.Notification
* @permission N/A
*/
export interface NotificationBasicContent {
@ -46,8 +45,7 @@ export interface NotificationBasicContent {
*
* @name NotificationLongTextContent
* @since 7
* @sysCap SystemCapability.Notification.ANS
* @devices phone, tablet, tv, wearable, car
* @syscap SystemCapability.Notification.Notification
* @permission N/A
*/
export interface NotificationLongTextContent extends NotificationBasicContent {
@ -72,8 +70,7 @@ export interface NotificationLongTextContent extends NotificationBasicContent {
*
* @name NotificationMultiLineContent
* @since 7
* @sysCap SystemCapability.Notification.ANS
* @devices phone, tablet, tv, wearable, car
* @syscap SystemCapability.Notification.Notification
* @permission N/A
*/
export interface NotificationMultiLineContent extends NotificationBasicContent {
@ -98,8 +95,7 @@ export interface NotificationMultiLineContent extends NotificationBasicContent {
*
* @name NotificationPictureContent
* @since 7
* @sysCap SystemCapability.Notification.ANS
* @devices phone, tablet, tv, wearable, car
* @syscap SystemCapability.Notification.Notification
* @permission N/A
*/
export interface NotificationPictureContent extends NotificationBasicContent {
@ -124,8 +120,7 @@ export interface NotificationPictureContent extends NotificationBasicContent {
*
* @name NotificationContent
* @since 7
* @sysCap SystemCapability.Notification.ANS
* @devices phone, tablet, tv, wearable, car
* @syscap SystemCapability.Notification.Notification
* @permission N/A
*/
export interface NotificationContent {

View File

@ -25,8 +25,7 @@ import { NotificationTemplate } from './notificationTemplate';
*
* @name NotificationRequest
* @since 7
* @sysCap SystemCapability.Notification.ANS
* @devices phone, tablet, tv, wearable, car
* @syscap SystemCapability.Notification.Notification
* @permission N/A
*/
export interface NotificationRequest {

View File

@ -20,9 +20,8 @@ import notification from '../@ohos.notification';
*
* @name NotificationSlot
* @since 7
* @devices phone, tablet, tv, wearable, car
* @permission N/A
* @sysCap SystemCapability.Notification.ANS
* @syscap SystemCapability.Notification.Notification
*/
export interface NotificationSlot {
/**

View File

@ -19,8 +19,7 @@ import { NotificationSlot } from './notificationSlot';
* Provides sorting information about an active notification.
*
* @name NotificationSorting
* @sysCap SystemCapability.Notification.ANS
* @devices phone, tablet, tv, wearable, car
* @syscap SystemCapability.Notification.Notification
* @permission N/A
* @systemapi Hide this for inner system use.
* @since 7

View File

@ -20,8 +20,7 @@ import { NotificationSorting } from './notificationSorting';
*
* @name NotificationSortingMap
* @since 7
* @sysCap SystemCapability.Notification.ANS
* @devices phone, tablet, tv, wearable, car
* @syscap SystemCapability.Notification.Notification
* @permission N/A
* @systemapi Hide this for inner system use.
*/

View File

@ -18,8 +18,7 @@
*
* @name NotificationSubscribeInfo
* @since 7
* @sysCap SystemCapability.Notification.ANS
* @devices phone, tablet, tv, wearable, car
* @syscap SystemCapability.Notification.Notification
* @permission N/A
* @systemapi Hide this for inner system use.
*/

View File

@ -22,8 +22,7 @@ import notification from '../@ohos.notification';
* a notification is canceled.
*
* @name NotificationSubscriber
* @sysCap SystemCapability.Notification.ANS
* @devices phone, tablet, tv, wearable, car
* @syscap SystemCapability.Notification.Notification
* @permission N/A
* @systemapi Hide this for inner system use.
* @since 7
@ -50,8 +49,7 @@ export interface NotificationSubscriber {
* a notification is canceled.
*
* @name SubscribeCallbackData
* @sysCap SystemCapability.Notification.ANS
* @devices phone, tablet, tv, wearable, car
* @syscap SystemCapability.Notification.Notification
* @permission N/A
* @systemapi Hide this for inner system use.
* @since 7

View File

@ -18,9 +18,8 @@
*
* @name NotificationTemplate
* @since 8
* @devices phone, tablet, tv, wearable, car
* @permission N/A
* @sysCap SystemCapability.Notification.ANS
* @syscap SystemCapability.Notification.Notification
*/
export interface NotificationTemplate {
/**

View File

@ -18,9 +18,8 @@
*
* @name NotificationUserInput
* @since 8
* @devices phone, tablet, tv, wearable, car
* @permission N/A
* @sysCap SystemCapability.Notification.ANS
* @syscap SystemCapability.Notification.Notification
*/
export interface NotificationUserInput {
/**