UNPKG

native-update

Version:

Foundation package for building a comprehensive update system for Capacitor apps. Provides architecture and interfaces but requires backend implementation.

30 lines (29 loc) 1.33 kB
import type { NotificationPreferences, NotificationPermissionStatus, AppUpdateInfo, LatestVersion } from '../definitions'; import { NotificationPriority } from '../definitions'; export interface NotificationData { title: string; body: string; data?: Record<string, unknown>; actions?: NotificationAction[]; } export interface NotificationAction { id: string; title: string; icon?: string; } export declare abstract class NotificationManager { protected preferences: NotificationPreferences; setPreferences(preferences: NotificationPreferences): void; abstract getPermissionStatus(): Promise<NotificationPermissionStatus>; abstract requestPermissions(): Promise<boolean>; abstract showNotification(data: NotificationData): Promise<boolean>; abstract cancelNotification(id: string): Promise<void>; abstract setupNotificationChannels(): Promise<void>; sendUpdateNotification(appUpdate?: AppUpdateInfo, liveUpdate?: LatestVersion): Promise<boolean>; protected createNotificationData(appUpdate?: AppUpdateInfo, liveUpdate?: LatestVersion): NotificationData; protected getChannelId(): string; protected getChannelName(): string; protected getPriority(): NotificationPriority; protected shouldPlaySound(): boolean; protected shouldVibrate(): boolean; }