diff --git a/interfaces/kits/js/@ohos.notification.d.ts b/interfaces/kits/js/@ohos.notification.d.ts index b1eb7f274a8d21dba6fa73a769434051c9060be2..eb44ec9b7e78216dfc001b5ee1526d4109784165 100644 --- a/interfaces/kits/js/@ohos.notification.d.ts +++ b/interfaces/kits/js/@ohos.notification.d.ts @@ -495,6 +495,44 @@ declare namespace notification { function getActiveNotifications(callback: AsyncCallback>): void; function getActiveNotifications(): Promise>; + /** + * Cancel the notification of a specified group for this application. + */ + function cancelGroup(groupName: string, callback: AsyncCallback): void; + function cancelGroup(groupName: string): Promise; + + /** + * Delete the notification of a specified group for this application. + * + * @systemapi Hide this for inner system use. + */ + function removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCallback): void; + function removeGroupByBundle(bundle: BundleOption, groupName: string): Promise; + + /** + * Set the Do Not Disturb date. + * + * @systemapi Hide this for inner system use. + */ + function setDoNotDisturbDate(date: DoNotDisturbDate, callback: AsyncCallback): void; + function setDoNotDisturbDate(date: DoNotDisturbDate): Promise; + + /** + * Obtains the Do Not Disturb date. + * + * @systemapi Hide this for inner system use. + */ + function getDoNotDisturbDate(callback: AsyncCallback): void; + function getDoNotDisturbDate(): Promise; + + /** + * Obtains whether to support the Do Not Disturb mode. + * + * @systemapi Hide this for inner system use. + */ + function supportDoNotDisturbMode(callback: AsyncCallback): void; + function supportDoNotDisturbMode(): Promise; + /** * Describes a BundleOption. */ @@ -541,6 +579,51 @@ declare namespace notification { */ ALLOW_ALARMS } + + /** + * The type of the Do Not Disturb. + * + * @systemapi Hide this for inner system use. + */ + export enum DoNotDisturbType { + TYPE_NONE = 0, // 非通知勿扰类型 + TYPE_ONCE = 1, // 以设置时间段(只看小时和分钟)一次执行勿扰 + TYPE_DAILY = 2, // 以设置时间段(只看小时和分钟)每天执行勿扰 + TYPE_CLEARLY = 3, // 以设置时间段(明确年月日时分)执行勿扰 + } + + /** + * Describes a DoNotDisturbDate instance. + * + * @systemapi Hide this for inner system use. + */ + export interface DoNotDisturbDate { + /** + * the type of the Do Not Disturb. + */ + type: DoNotDisturbType; + + /** + * the start time of the Do Not Disturb. + */ + begin: Date; + + /** + * the end time of the Do Not Disturb. + */ + end: Date; + } + + /** + * Notification source type + * + * @systemapi Hide this for inner system use. + */ + export enum SourceType { + TYPE_NORMAL = 0x00000000, // 普通通知 + TYPE_CONTINUOUS = 0x00000001, // 长时任务通知 + TYPE_TIMER = 0x00000002, // 定时通知 + } } export default notification; diff --git a/interfaces/kits/js/notification/notificationActionButton.d.ts b/interfaces/kits/js/notification/notificationActionButton.d.ts index 39cc3db49ea37fe7a708c51f36b0854e14ce90a9..bf2549c696b2c4df105ace9c11ab2ae2d4968ea0 100644 --- a/interfaces/kits/js/notification/notificationActionButton.d.ts +++ b/interfaces/kits/js/notification/notificationActionButton.d.ts @@ -13,6 +13,7 @@ * limitations under the License. */ +import { NotificationUserInput } from './notificationUserInput'; import { WantAgent } from '../@ohos.wantAgent'; /** @@ -38,4 +39,9 @@ export interface NotificationActionButton { * Extra information of the button. */ extras?: {[key: string]: any}; + + /** + * User input + */ + userInput?: NotificationUserInput; } diff --git a/interfaces/kits/js/notification/notificationRequest.d.ts b/interfaces/kits/js/notification/notificationRequest.d.ts index b7e6575057d9b8eaf3e11c0bf7ab21d13628bf5f..ce183326fee650449a42828ef2fb1c7fdebcd735 100644 --- a/interfaces/kits/js/notification/notificationRequest.d.ts +++ b/interfaces/kits/js/notification/notificationRequest.d.ts @@ -139,6 +139,11 @@ export interface NotificationRequest { */ largeIcon?: image.PixelMap; + /** + * The group information for this notification. + */ + groupName?: string; + /** * Read-only name of the package for which a notification is created. */ @@ -165,4 +170,18 @@ export interface NotificationRequest { * Obtains the unique hash code of a notification in the current application. */ readonly hashCode?: string; + + /** + * Whether the notification can be remove. + * + * @systemapi Hide this for inner system use. + */ + readonly isRemoveAllowed?: boolean; + + /** + * Notification source. enum SourceType + * + * @systemapi Hide this for inner system use. + */ + readonly source?: number; } diff --git a/interfaces/kits/js/notification/notificationSubscriber.d.ts b/interfaces/kits/js/notification/notificationSubscriber.d.ts index a659a9d0f17b31028603b3228d257116df9a78ba..2b3f57ee9ea164122fb194ac4a45a4fecdb334f7 100644 --- a/interfaces/kits/js/notification/notificationSubscriber.d.ts +++ b/interfaces/kits/js/notification/notificationSubscriber.d.ts @@ -36,6 +36,7 @@ export interface NotificationSubscriber { onDisconnect?:() => void; onDestroy?:() => void; onDisturbModeChange?:(mode: notification.DoNotDisturbMode) => void; + onDoNotDisturbDateChange?:(mode: notification.DoNotDisturbDate) => void; } /** diff --git a/interfaces/kits/js/notification/notificationUserInput.d.ts b/interfaces/kits/js/notification/notificationUserInput.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1b44e878efec0ca8dc40b4a0fc78a93dbd384f12 --- /dev/null +++ b/interfaces/kits/js/notification/notificationUserInput.d.ts @@ -0,0 +1,30 @@ +/* + * 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 NotificationUserInput instance. + * + * @name NotificationUserInput + * @since 7 + * @devices phone, tablet, tv, wearable, car + * @permission N/A + * @sysCap SystemCapability.Notification.ANS + */ +export interface NotificationUserInput { + /** + * Obtains the key used to identify this input when the input is collected from the user. + */ + inputKey: string; +}