notification-kit
Version:
A unified notification library for React + Capacitor apps. One API for push notifications, in-app notifications, and local notifications across Web, iOS, and Android.
128 lines • 5.71 kB
TypeScript
import { NotificationKit } from './core/NotificationKit';
import { PlatformDetection, PlatformCapabilities } from './types';
export { NotificationKit, notifications } from './core/NotificationKit';
export { FirebaseProvider } from './providers/FirebaseProvider';
export { OneSignalProvider } from './providers/OneSignalProvider';
export { PermissionManager, permissionManager, permissions, } from './core/permissions';
export { PlatformManager, platformManager, platform } from './core/platform';
export { StorageManager, storage, createStorage } from './core/storage';
export { ValidationUtils, validate } from './utils/validation';
export { FormattingUtils, format } from './utils/formatting';
export { SchedulingUtils } from './utils/scheduling';
export { InAppNotificationManager, showInAppNotification, dismissInAppNotification, dismissAllInAppNotifications, getActiveInAppNotifications, configureInAppNotifications, inApp, } from './utils/inApp';
export { toCapacitorImportance, fromCapacitorImportance, toCapacitorChannel, fromCapacitorChannel, toCapacitorLocalNotification, fromCapacitorLocalNotification, toPlatformCapabilities, } from './utils/capacitor-types';
export type { NotificationConfig, NotificationProvider, NotificationPermissionStatus, Notification, NotificationAction, NotificationChannel, NotificationEvents, NotificationEventCallback, Platform, PlatformCapabilities, PlatformDetection, PlatformConfig, PlatformDefaults, PlatformCompatibility, } from './types';
export type { ProviderConfig, FirebaseConfig, OneSignalConfig, ProviderCapabilities, ProviderStatistics, ProviderHealth, ProviderMetadata, ProviderLimits, ProviderEndpoints, ProviderAuthentication, ProviderWebhook, } from './types';
export type { PushNotificationPayload, LocalNotificationPayload, InAppNotificationPayload, ScheduleOptions, InAppOptions, NotificationSchedule, ScheduleAt, ScheduleOn, ScheduleEvery, ScheduleResult, } from './types';
export type { StyleConfig, AnimationConfig, ServiceWorkerConfig, StorageConfig, AnalyticsConfig, InitOptions, EnvironmentConfig, FeatureFlags, LocalizationConfig, SecurityConfig, BackupConfig, } from './types';
export type { NotificationReceivedEvent, NotificationActionPerformedEvent, NotificationSentEvent, NotificationScheduledEvent, NotificationCancelledEvent, NotificationChannelCreatedEvent, NotificationChannelDeletedEvent, TokenReceivedEvent, TokenRefreshedEvent, PermissionChangedEvent, SubscribedEvent, UnsubscribedEvent, ReadyEvent, ErrorEvent, } from './types';
export type { PermissionStatus, PermissionType } from './types';
export type { ChannelImportance, ChannelVisibility, ChannelLockScreenVisibility, ChannelSound, ChannelVibration, ChannelLights, ChannelGroup, } from './types';
export type { ValidationError, ValidationWarning } from './types';
export type { InAppNotificationInstance } from './utils/inApp';
export default NotificationKit;
export declare const version = "2.0.0";
export declare const metadata: {
name: string;
version: string;
description: string;
author: string;
license: string;
homepage: string;
repository: string;
bugs: string;
keywords: string[];
platforms: string[];
frameworks: string[];
providers: string[];
};
export declare const quickStart: {
initFirebase: (config: {
apiKey: string;
authDomain: string;
projectId: string;
storageBucket: string;
messagingSenderId: string;
appId: string;
measurementId?: string;
vapidKey?: string;
}) => Promise<void>;
initOneSignal: (config: {
appId: string;
restApiKey?: string;
safariWebId?: string;
}) => Promise<void>;
setup: () => Promise<{
granted: true;
token: string;
} | {
granted: false;
token: null;
}>;
success: (title: string, message?: string) => Promise<string>;
error: (title: string, message?: string) => Promise<string>;
warning: (title: string, message?: string) => Promise<string>;
info: (title: string, message?: string) => Promise<string>;
scheduleLocal: (options: {
id: string | number;
title: string;
body: string;
schedule: {
at: Date | string;
};
}) => Promise<void>;
subscribe: (topic: string) => Promise<void>;
unsubscribe: (topic: string) => Promise<void>;
};
export declare const features: {
pushNotifications: boolean;
localNotifications: boolean;
inAppNotifications: boolean;
channels: boolean;
actions: boolean;
scheduling: boolean;
topics: boolean;
analytics: boolean;
permissions: boolean;
storage: boolean;
validation: boolean;
formatting: boolean;
react: boolean;
firebase: boolean;
onesignal: boolean;
typescript: boolean;
};
export declare const compatibility: {
web: {
chrome: string;
firefox: string;
safari: string;
edge: string;
opera: string;
};
mobile: {
ios: string;
android: string;
};
features: {
pushNotifications: string[];
serviceWorker: string[];
notifications: string[];
vibration: string[];
badging: string[];
};
};
export declare const dev: {
enableDebug: () => void;
disableDebug: () => void;
isDebugEnabled: () => boolean;
getPlatformInfo: () => Promise< PlatformDetection>;
getCapabilities: () => Promise< PlatformCapabilities>;
test: {
inApp: () => Promise<string>;
permission: () => Promise<boolean>;
token: () => Promise<string>;
schedule: () => Promise<void>;
};
};
//# sourceMappingURL=index.d.ts.map