{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,wCAAwC","sourcesContent":["/// \n\nimport type { PermissionState, PluginListenerHandle } from '@capacitor/core';\n\nexport type PresentationOption = 'badge' | 'sound' | 'alert' | 'banner' | 'list';\n\ndeclare module '@capacitor/cli' {\n export interface PluginsConfig {\n /**\n * You can configure the way the push notifications are displayed when the app is in foreground.\n */\n PushNotifications?: {\n /**\n * This is an array of strings you can combine. Possible values in the array are:\n * - `badge`: badge count on the app icon is updated (default value)\n * - `sound`: the device will ring/vibrate when the push notification is received\n * - `alert`: **Deprecated on iOS.** Use `banner` and `list` instead. On Android, this value is still used to display the notification.\n * - `banner`: the push notification is displayed as a banner. On Android, defaults to the same behavior as `alert`.\n * - `list`: the push notification is displayed in the notification center. On Android, defaults to the same behavior as `alert`.\n *\n * An empty array can be provided if none of the options are desired.\n *\n * badge is only available for iOS.\n *\n * @since 1.0.0\n * @example [\"badge\", \"sound\", \"alert\", \"banner\", \"list\"]\n */\n presentationOptions: PresentationOption[];\n };\n }\n}\n\nexport interface PushNotificationsPlugin {\n /**\n * Register the app to receive push notifications.\n *\n * This method will trigger the `'registration'` event with the push token or\n * `'registrationError'` if there was a problem. It does not prompt the user for\n * notification permissions, use `requestPermissions()` first.\n *\n * @since 1.0.0\n */\n register(): Promise;\n\n /**\n * Unregister the app from push notifications.\n *\n * This will delete a firebase token on Android, and unregister APNS on iOS.\n *\n * @since 5.0.0\n */\n unregister(): Promise;\n\n /**\n * Get a list of notifications that are visible on the notifications screen.\n *\n * @since 1.0.0\n */\n getDeliveredNotifications(): Promise;\n\n /**\n * Remove the specified notifications from the notifications screen.\n *\n * @since 1.0.0\n */\n removeDeliveredNotifications(delivered: DeliveredNotifications): Promise;\n\n /**\n * Remove all the notifications from the notifications screen.\n *\n * @since 1.0.0\n */\n removeAllDeliveredNotifications(): Promise;\n\n /**\n * Create a notification channel.\n *\n * Only available on Android O or newer (SDK 26+).\n *\n * @since 1.0.0\n */\n createChannel(channel: Channel): Promise;\n\n /**\n * Delete a notification channel.\n *\n * Only available on Android O or newer (SDK 26+).\n *\n * @since 1.0.0\n */\n deleteChannel(args: { id: string }): Promise;\n\n /**\n * List the available notification channels.\n *\n * Only available on Android O or newer (SDK 26+).\n *\n * @since 1.0.0\n */\n listChannels(): Promise;\n\n /**\n * Check permission to receive push notifications.\n *\n * On Android 12 and below the status is always granted because you can always\n * receive push notifications. If you need to check if the user allows\n * to display notifications, use local-notifications plugin.\n *\n * @since 1.0.0\n */\n checkPermissions(): Promise;\n\n /**\n * Request permission to receive push notifications.\n *\n * On Android 12 and below it doesn't prompt for permission because you can always\n * receive push notifications.\n *\n * On iOS, the first time you use the function, it will prompt the user\n * for push notification permission and return granted or denied based\n * on the user selection. On following calls it will get the current status of\n * the permission without prompting again.\n *\n * @since 1.0.0\n */\n requestPermissions(): Promise;\n\n /**\n * Called when the push notification registration finishes without problems.\n *\n * Provides the push notification token.\n *\n * @since 1.0.0\n */\n addListener(eventName: 'registration', listenerFunc: (token: Token) => void): Promise;\n\n /**\n * Called when the push notification registration finished with problems.\n *\n * Provides an error with the registration problem.\n *\n * @since 1.0.0\n */\n addListener(\n eventName: 'registrationError',\n listenerFunc: (error: RegistrationError) => void,\n ): Promise;\n\n /**\n * Called when the device receives a push notification.\n *\n * @since 1.0.0\n */\n addListener(\n eventName: 'pushNotificationReceived',\n listenerFunc: (notification: PushNotificationSchema) => void,\n ): Promise;\n\n /**\n * Called when an action is performed on a push notification.\n *\n * @since 1.0.0\n */\n addListener(\n eventName: 'pushNotificationActionPerformed',\n listenerFunc: (notification: ActionPerformed) => void,\n ): Promise;\n\n /**\n * Remove all native listeners for this plugin.\n *\n * @since 1.0.0\n */\n removeAllListeners(): Promise;\n}\n\nexport interface PushNotificationSchema {\n /**\n * The notification title.\n *\n * @since 1.0.0\n */\n title?: string;\n\n /**\n * The notification subtitle.\n *\n * @since 1.0.0\n */\n subtitle?: string;\n\n /**\n * The main text payload for the notification.\n *\n * @since 1.0.0\n */\n body?: string;\n\n /**\n * The notification identifier.\n *\n * @since 1.0.0\n */\n id: string;\n\n /**\n * The notification tag.\n *\n * Only available on Android (from push notifications).\n *\n * @since 4.0.0\n */\n tag?: string;\n\n /**\n * The number to display for the app icon badge.\n *\n * @since 1.0.0\n */\n badge?: number;\n\n /**\n * It's not being returned.\n *\n * @deprecated will be removed in next major version.\n * @since 1.0.0\n */\n notification?: any;\n\n /**\n * Any additional data that was included in the\n * push notification payload.\n *\n * @since 1.0.0\n */\n data: any;\n\n /**\n * The action to be performed on the user opening the notification.\n *\n * Only available on Android.\n *\n * @since 1.0.0\n */\n click_action?: string;\n\n /**\n * Deep link from the notification.\n *\n * Only available on Android.\n *\n * @since 1.0.0\n */\n link?: string;\n\n /**\n * Set the group identifier for notification grouping.\n *\n * Only available on Android. Works like `threadIdentifier` on iOS.\n *\n * @since 1.0.0\n */\n group?: string;\n\n /**\n * Designate this notification as the summary for an associated `group`.\n *\n * Only available on Android.\n *\n * @since 1.0.0\n */\n groupSummary?: boolean;\n}\n\nexport interface ActionPerformed {\n /**\n * The action performed on the notification.\n *\n * @since 1.0.0\n */\n actionId: string;\n\n /**\n * Text entered on the notification action.\n *\n * Only available on iOS.\n *\n * @since 1.0.0\n */\n inputValue?: string;\n\n /**\n * The notification in which the action was performed.\n *\n * @since 1.0.0\n */\n notification: PushNotificationSchema;\n}\n\nexport interface Token {\n /**\n * On iOS it contains the APNS token.\n * On Android it contains the FCM token.\n *\n * @since 1.0.0\n */\n value: string;\n}\n\nexport interface RegistrationError {\n /**\n * Error message describing the registration failure.\n *\n * @since 4.0.0\n */\n error: string;\n}\n\nexport interface DeliveredNotifications {\n /**\n * List of notifications that are visible on the\n * notifications screen.\n *\n * @since 1.0.0\n */\n notifications: PushNotificationSchema[];\n}\n\nexport interface Channel {\n /**\n * The channel identifier.\n *\n * @since 1.0.0\n */\n id: string;\n\n /**\n * The human-friendly name of this channel (presented to the user).\n *\n * @since 1.0.0\n */\n name: string;\n\n /**\n * The description of this channel (presented to the user).\n *\n * @since 1.0.0\n */\n description?: string;\n\n /**\n * The sound that should be played for notifications posted to this channel.\n *\n * Notification channels with an importance of at least `3` should have a\n * sound.\n *\n * The file name of a sound file should be specified relative to the android\n * app `res/raw` directory.\n *\n * @since 1.0.0\n * @example \"jingle.wav\"\n */\n sound?: string;\n\n /**\n * The level of interruption for notifications posted to this channel.\n *\n * @default `3`\n * @since 1.0.0\n */\n importance?: Importance;\n\n /**\n * The visibility of notifications posted to this channel.\n *\n * This setting is for whether notifications posted to this channel appear on\n * the lockscreen or not, and if so, whether they appear in a redacted form.\n *\n * @since 1.0.0\n */\n visibility?: Visibility;\n\n /**\n * Whether notifications posted to this channel should display notification\n * lights, on devices that support it.\n *\n * @since 1.0.0\n */\n lights?: boolean;\n\n /**\n * The light color for notifications posted to this channel.\n *\n * Only supported if lights are enabled on this channel and the device\n * supports it.\n *\n * Supported color formats are `#RRGGBB` and `#RRGGBBAA`.\n *\n * @since 1.0.0\n */\n lightColor?: string;\n\n /**\n * Whether notifications posted to this channel should vibrate.\n *\n * @since 1.0.0\n */\n vibration?: boolean;\n}\n\n/**\n * The importance level. For more details, see the [Android Developer Docs](https://developer.android.com/reference/android/app/NotificationManager#IMPORTANCE_DEFAULT)\n * @since 1.0.0\n */\nexport type Importance = 0 | 1 | 2 | 3 | 4 | 5;\n\n/**\n * The notification visibility. For more details, see the [Android Developer Docs](https://developer.android.com/reference/androidx/core/app/NotificationCompat#VISIBILITY_PRIVATE)\n * @since 1.0.0\n */\nexport type Visibility = -1 | 0 | 1;\n\nexport interface ListChannelsResult {\n /**\n * List of all the Channels created by your app.\n *\n * @since 1.0.0\n */\n channels: Channel[];\n}\n\nexport interface PermissionStatus {\n /**\n * Permission state of receiving notifications.\n *\n * @since 1.0.0\n */\n receive: PermissionState;\n}\n\n/**\n * @deprecated Use 'Channel`.\n * @since 1.0.0\n */\nexport type NotificationChannel = Channel;\n\n/**\n * @deprecated Use `ListChannelsResult`.\n * @since 1.0.0\n */\nexport type NotificationChannelList = ListChannelsResult;\n\n/**\n * @deprecated Use `PushNotificationSchema`.\n * @since 1.0.0\n */\nexport type PushNotification = PushNotificationSchema;\n\n/**\n * @deprecated Use `ActionPerformed`.\n * @since 1.0.0\n */\nexport type PushNotificationActionPerformed = ActionPerformed;\n\n/**\n * @deprecated Use `DeliveredNotifications`.\n * @since 1.0.0\n */\nexport type PushNotificationDeliveredList = DeliveredNotifications;\n\n/**\n * @deprecated Use `Token`.\n * @since 1.0.0\n */\nexport type PushNotificationToken = Token;\n"]}