From 4ded1ed2aefd74856813b233b41cfb17a8464519 Mon Sep 17 00:00:00 2001 From: Nicholas Solter Date: Tue, 25 Jul 2023 20:55:36 -0600 Subject: [PATCH] Fixes 418: adds documentation and type definitions for interruptionLevel prop --- README.md | 3 ++- index.d.ts | 5 +++++ js/types.js | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a6a247f1..199aafae 100644 --- a/README.md +++ b/README.md @@ -357,8 +357,9 @@ request is an object containing: - `criticalSoundVolume` : A number between 0 and 1 for volume of critical notification. Default volume will be used if not specified. - `userInfo` : An object containing additional notification data. - `isTimeZoneAgnostic` : If true, fireDate adjusted automatically upon time zone changes (e.g. for an alarm clock). +- `interruptionLevel` (iOS15+): A string specifying the interruption level. Valid values are `'active'`, `'passive'`, `'timeSensitive'`, or `'critical'` -request.repeatsComponent is an object containing (each field is optionnal): +request.repeatsComponent is an object containing (each field is optional): - `year`: Will repeat every selected year in your fireDate. - `month`: Will repeat every selected month in your fireDate. diff --git a/index.d.ts b/index.d.ts index 06bdd536..7111d1d6 100644 --- a/index.d.ts +++ b/index.d.ts @@ -203,6 +203,11 @@ export type NotificationRequest = { * Optional data to be added to the notification */ userInfo?: Record; + /** + * The interruption level for the notification. + * Possible values: 'passive', 'active', 'timeSensitive', 'critical' + */ + interruptionLevel?: 'passive' | 'active' | 'timeSensitive' | 'critical', }; /** diff --git a/js/types.js b/js/types.js index eea09a13..1a7c0a6c 100644 --- a/js/types.js +++ b/js/types.js @@ -78,6 +78,11 @@ export type NotificationRequest = {| * FireDate adjusted automatically upon time zone changes (e.g. for an alarm clock). */ isTimeZoneAgnostic?: boolean, + /** + * The interruption level for the notification. + * Possible values: 'passive', 'active', 'timeSensitive', 'critical' + */ + interruptionLevel?: 'passive' | 'active' | 'timeSensitive' | 'critical', |}; /**