UNPKG

capacitor-native-update

Version:
71 lines (70 loc) 2.9 kB
import { WebPlugin } from '@capacitor/core'; import type { NativeUpdateCombinedPlugin, UpdateConfig, SecurityInfo, SyncOptions, SyncResult, DownloadOptions, BundleInfo, DeleteOptions, LatestVersion, ValidateOptions, ValidationResult, AppUpdateInfo, OpenAppStoreOptions, ReviewResult, CanRequestReviewResult, BackgroundUpdateConfig, BackgroundUpdateStatus, BackgroundCheckResult, NotificationPreferences, NotificationPermissionStatus } from './definitions'; export declare class NativeUpdateWeb extends WebPlugin implements NativeUpdateCombinedPlugin { private config; private currentBundle; private bundles; private lastReviewRequest; private launchCount; private backgroundUpdateStatus; private backgroundCheckInterval; constructor(); /** * Configuration and Core Methods */ configure(options: UpdateConfig): Promise<void>; getSecurityInfo(): Promise<SecurityInfo>; /** * Live Update Methods */ sync(_options?: SyncOptions): Promise<SyncResult>; download(options: DownloadOptions): Promise<BundleInfo>; set(bundle: BundleInfo): Promise<void>; reload(): Promise<void>; reset(): Promise<void>; current(): Promise<BundleInfo>; list(): Promise<BundleInfo[]>; delete(options: DeleteOptions): Promise<void>; notifyAppReady(): Promise<void>; getLatest(): Promise<LatestVersion>; setChannel(channel: string): Promise<void>; setUpdateUrl(url: string): Promise<void>; validateUpdate(options: ValidateOptions): Promise<ValidationResult>; /** * App Update Methods */ getAppUpdateInfo(): Promise<AppUpdateInfo>; performImmediateUpdate(): Promise<void>; startFlexibleUpdate(): Promise<void>; completeFlexibleUpdate(): Promise<void>; openAppStore(_options?: OpenAppStoreOptions): Promise<void>; /** * App Review Methods */ requestReview(): Promise<ReviewResult>; canRequestReview(): Promise<CanRequestReviewResult>; /** * Background Update Methods */ enableBackgroundUpdates(config: BackgroundUpdateConfig): Promise<void>; disableBackgroundUpdates(): Promise<void>; getBackgroundUpdateStatus(): Promise<BackgroundUpdateStatus>; scheduleBackgroundCheck(interval: number): Promise<void>; triggerBackgroundCheck(): Promise<BackgroundCheckResult>; setNotificationPreferences(preferences: NotificationPreferences): Promise<void>; getNotificationPermissions(): Promise<NotificationPermissionStatus>; requestNotificationPermissions(): Promise<boolean>; private sendWebNotification; /** * Helper Methods */ private createError; private createDefaultBundle; private validateChecksum; private validateSignature; private loadStoredData; private saveStoredData; private saveConfiguration; private getInstallDate; private incrementLaunchCount; }