From b299a25ed402a2b32ac2e02d19eb9c8d1f337a24 Mon Sep 17 00:00:00 2001 From: njupthan Date: Tue, 11 Jan 2022 16:35:35 +0000 Subject: [PATCH] Update all dts to master branch of ANS and SDK repositories Signed-off-by: njupthan --- api/@ohos.notification.d.ts | 74 +++++++++++++++---- api/@ohos.wantAgent.d.ts | 27 +------ .../notificationActionButton.d.ts | 2 +- api/notification/notificationContent.d.ts | 73 +++++++++++++++++- api/notification/notificationMessageUser.d.ts | 57 ++++++++++++++ api/notification/notificationRequest.d.ts | 2 +- api/notification/notificationSubscriber.d.ts | 1 - api/notification/notificationUserInput.d.ts | 27 ++++++- 8 files changed, 219 insertions(+), 44 deletions(-) create mode 100644 api/notification/notificationMessageUser.d.ts diff --git a/api/@ohos.notification.d.ts b/api/@ohos.notification.d.ts index c24a7a258e..edbbd33d71 100644 --- a/api/@ohos.notification.d.ts +++ b/api/@ohos.notification.d.ts @@ -569,34 +569,82 @@ declare namespace notification { } /** - * DisturbMode + * The type of the Do Not Disturb. + * + * @since 8 + * @systemapi Hide this for inner system use. + */ + export enum DoNotDisturbType { + /** + * Non do not disturb type notification + */ + TYPE_NONE = 0, + + /** + * Execute do not disturb once in the set time period (only watch hours and minutes) + */ + TYPE_ONCE = 1, + + /** + * Execute do not disturb every day with a set time period (only watch hours and minutes) + */ + TYPE_DAILY = 2, + + /** + * Execute in the set time period (specify the time, month, day and hour) + */ + TYPE_CLEARLY = 3, + } + + /** + * Describes a DoNotDisturbDate instance. * * @systemapi Hide this for inner system use. */ - export enum DoNotDisturbMode { - ALLOW_UNKNOWN, + export interface DoNotDisturbDate { + /** + * the type of the Do Not Disturb. + * + * @since 8 + */ + type: DoNotDisturbType; /** - * Indicates that all notifications are allowed to interrupt the user in Do Not Disturb mode. + * the start time of the Do Not Disturb. + * + * @since 8 + */ + begin: Date; + + /** + * the end time of the Do Not Disturb. + * + * @since 8 */ - ALLOW_ALL, + end: Date; + } + /** + * Notification source type + * + * @since 8 + * @systemapi Hide this for inner system use. + */ + export enum SourceType { /** - * Indicates that only notifications meeting the specified priority criteria are allowed to interrupt - * the user in Do Not Disturb mode. + * General notification */ - ALLOW_PRIORITY, + TYPE_NORMAL = 0x00000000, /** - * Indicates that no notifications are allowed to interrupt the user in Do Not Disturb mode. + * Continuous notification */ - ALLOW_NONE, + TYPE_CONTINUOUS = 0x00000001, /** - * Indicates that only notifications of the {@link NotificationRequest#CLASSIFICATION_ALARM} category - * are allowed to interrupt the user in Do Not Disturb mode. + * Scheduled notification */ - ALLOW_ALARMS + TYPE_TIMER = 0x00000002, } /** diff --git a/api/@ohos.wantAgent.d.ts b/api/@ohos.wantAgent.d.ts index 17dd1c8aa2..e5de044ce7 100644 --- a/api/@ohos.wantAgent.d.ts +++ b/api/@ohos.wantAgent.d.ts @@ -132,32 +132,7 @@ declare namespace wantAgent { /** * 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 + CONSTANT_FLAG } /** diff --git a/api/notification/notificationActionButton.d.ts b/api/notification/notificationActionButton.d.ts index d67934492a..9428cc4f0d 100644 --- a/api/notification/notificationActionButton.d.ts +++ b/api/notification/notificationActionButton.d.ts @@ -4,7 +4,7 @@ * 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 + * 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, diff --git a/api/notification/notificationContent.d.ts b/api/notification/notificationContent.d.ts index d2cc36ebdc..037300c24b 100644 --- a/api/notification/notificationContent.d.ts +++ b/api/notification/notificationContent.d.ts @@ -14,7 +14,9 @@ */ import notification from '../@ohos.notification'; -import image from './@ohos.multimedia.image'; +import image from '../@ohos.multimedia.image'; +import { MessageUser } from './notificationMessageUser'; + /** * Describes a normal text notification. * @@ -119,6 +121,68 @@ export interface NotificationPictureContent extends NotificationBasicContent { picture: image.PixelMap; } +/** + * Constructs a conversation-like notification that includes message communication among multiple users. + * + * @since 8 + */ +export interface NotificationConversationalContent extends NotificationBasicContent { + /** + * Indicates the {@code MessageUser} who sends all objects in this conversation-like notification. + * This parameter cannot be null. + */ + user: MessageUser; + + /** + * Obtains all messages included in this conversation-like notification. + */ + messages: Array; + + /** + * Checks whether this notification represents a group conversation. + */ + conversationGroup?: boolean; + + /** + * Obtains the title to be displayed for the conversation. + */ + conversationTitle?: string; +} + +/** + * Provides methods for defining a conversational message that is used in notifications created with + * {@link NotificationConversationalContent}. Each message contains the message content, timestamp, and + * sender; and the message content and sender information will be displayed in the notification bar. + * + * @since 8 + */ +export interface ConversationalMessage { + /** + * Obtains the text to be displayed as the content of this message. + */ + text: string; + + /** + * Obtains the time when this message arrived. + */ + timestamp: number; + + /** + * Obtains the sender of this message. + */ + sender: MessageUser; + + /** + * Obtains the MIME type of this message. + */ + mimeType?: string; + + /** + * Obtains the URI of this message. + */ + uri?: string; +} + /** * Describes notification types. * @@ -153,4 +217,11 @@ export interface NotificationContent { * Picture-attached notification. */ picture?: NotificationPictureContent; + + /** + * Constructs a conversation-like notification that includes message communication among multiple users. + * + * @since 8 + */ + conversation?: NotificationConversationalContent; } diff --git a/api/notification/notificationMessageUser.d.ts b/api/notification/notificationMessageUser.d.ts new file mode 100644 index 0000000000..40d01bde11 --- /dev/null +++ b/api/notification/notificationMessageUser.d.ts @@ -0,0 +1,57 @@ +/* + * 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 image from '../@ohos.multimedia.image'; + +/** + * Represents a message sender that can be used by {@link NotificationRequest}, + * + * @name MessageUser + * @since 8 + * @devices phone, tablet, tv, wearable, car + * @permission N/A + * @sysCap SystemCapability.Notification.ANS + */ +export interface MessageUser { + /** + * Obtains the name of this {@code MessageUser}. + */ + name: string; + + /** + * Obtains the key of this {@code MessageUser}. + */ + key: string; + + /** + * Obtains the URI of this {@code MessageUser}. + */ + uri: string; + + /** + * Checks whether this {@code MessageUser} is important. + */ + isMachine: boolean; + + /** + * Checks whether this {@code MessageUser} is a machine. + */ + isUserImportant: boolean; + + /** + * Obtains the icon of this {@code MessageUser}. + */ + icon?: image.PixelMap; +} diff --git a/api/notification/notificationRequest.d.ts b/api/notification/notificationRequest.d.ts index 669a492e34..6525bf19ea 100644 --- a/api/notification/notificationRequest.d.ts +++ b/api/notification/notificationRequest.d.ts @@ -4,7 +4,7 @@ * 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 + * 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, diff --git a/api/notification/notificationSubscriber.d.ts b/api/notification/notificationSubscriber.d.ts index d8e2277bc7..3ae878775d 100644 --- a/api/notification/notificationSubscriber.d.ts +++ b/api/notification/notificationSubscriber.d.ts @@ -35,7 +35,6 @@ export interface NotificationSubscriber { onConnect?:() => void; onDisconnect?:() => void; onDestroy?:() => void; - onDisturbModeChange?:(mode: notification.DoNotDisturbMode) => void; /** * Callback when the Do Not Disturb setting changed. diff --git a/api/notification/notificationUserInput.d.ts b/api/notification/notificationUserInput.d.ts index 63f0229887..389d1c43c7 100644 --- a/api/notification/notificationUserInput.d.ts +++ b/api/notification/notificationUserInput.d.ts @@ -4,7 +4,7 @@ * 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 + * 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, @@ -27,4 +27,29 @@ export interface NotificationUserInput { * Obtains the key used to identify this input when the input is collected from the user. */ inputKey: string; + + /** + * Obtains the tag to be displayed to the user when collecting this input from the user. + */ + tag: string; + + /** + * Obtains the options provided to users to satisfy user input needs. All options are displayed in a single line. + */ + options: Array; + + /** + * Obtains whether users can input values of the given MIME type. + */ + permitMimeTypes?: Array; + + /** + * Obtains the edit type of the options provided by this {@code NotificationUserInput} object. + */ + editType?: number; + + /** + * Obtains additional data to this NotificationUserInput. + */ + additionalData?: {[key: string]: Object}; } -- Gitee