/**
 * Global Type Declarations
 * 
 * Type definitions for global objects and plugins
 * 
 * @author Matthew Raymer
 * @version 1.0.0
 */

declare global {
  interface Window {
    DailyNotification?: {
      checkStatus(): Promise<{
        canScheduleNow: boolean
        postNotificationsGranted: boolean
        channelEnabled: boolean
        channelImportance: number
        channelId: string
        exactAlarmsGranted: boolean
        exactAlarmsSupported: boolean
        androidVersion: number
        nextScheduledAt: number
      }>
      scheduleNotification(options: {
        title: string
        body: string
        scheduledTime: number
      }): Promise<void>
      cancelNotification(id: string): Promise<void>
      requestPermissions(): Promise<boolean>
      getNotificationStatus(): Promise<{
        isEnabled: boolean
        isScheduled: boolean
        lastNotificationTime: number
        nextNotificationTime: number
        pending: number
        error?: string
      }>
      checkPermissions(): Promise<{
        notifications: 'granted' | 'denied' | 'prompt'
        exactAlarms: 'granted' | 'denied' | 'not_supported'
        batteryOptimization: 'granted' | 'denied' | 'not_supported'
        overall: 'ready' | 'partial' | 'blocked'
      }>
      getExactAlarmStatus(): Promise<{
        supported: boolean
        enabled: boolean
        canSchedule: boolean
      }>
      requestNotificationPermissions(): Promise<void>
    }
    Capacitor?: {
      Plugins?: {
        DailyNotification?: {
          checkStatus(): Promise<{
            canScheduleNow: boolean
            postNotificationsGranted: boolean
            channelEnabled: boolean
            channelImportance: number
            channelId: string
            exactAlarmsGranted: boolean
            exactAlarmsSupported: boolean
            androidVersion: number
            nextScheduledAt: number
          }>
          scheduleNotification(options: {
            title: string
            body: string
            scheduledTime: number
          }): Promise<void>
          cancelNotification(id: string): Promise<void>
          requestPermissions(): Promise<boolean>
          getNotificationStatus(): Promise<{
            isEnabled: boolean
            isScheduled: boolean
            lastNotificationTime: number
            nextNotificationTime: number
            pending: number
            error?: string
          }>
          checkPermissions(): Promise<{
            notifications: 'granted' | 'denied' | 'prompt'
            exactAlarms: 'granted' | 'denied' | 'not_supported'
            batteryOptimization: 'granted' | 'denied' | 'not_supported'
            overall: 'ready' | 'partial' | 'blocked'
          }>
          getExactAlarmStatus(): Promise<{
            supported: boolean
            enabled: boolean
            canSchedule: boolean
          }>
          requestNotificationPermissions(): Promise<void>
        }
        Clipboard?: {
          write(options: { string: string }): Promise<void>
        }
      }
    }
  }
}

export {}
