UNPKG

native-update

Version:

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

49 lines (48 loc) 1.65 kB
import type { Filesystem } from '@capacitor/filesystem'; import type { Preferences } from '@capacitor/preferences'; import type { UpdateStrategy, ChecksumAlgorithm, SecurityConfig } from '../definitions'; export interface PluginConfig { filesystem?: typeof Filesystem; preferences?: typeof Preferences; baseUrl?: string; allowedHosts?: string[]; maxBundleSize?: number; downloadTimeout?: number; retryAttempts?: number; retryDelay?: number; enableSignatureValidation?: boolean; publicKey?: string; cacheExpiration?: number; enableLogging?: boolean; serverUrl?: string; channel?: string; autoCheck?: boolean; autoUpdate?: boolean; updateStrategy?: UpdateStrategy; requireSignature?: boolean; checksumAlgorithm?: ChecksumAlgorithm; checkInterval?: number; security?: SecurityConfig; promptAfterPositiveEvents?: boolean; maxPromptsPerVersion?: number; minimumDaysSinceLastPrompt?: number; isPremiumUser?: boolean; appStoreId?: string; iosAppId?: string; packageName?: string; webReviewUrl?: string; minimumVersion?: string; } export declare class ConfigManager { private static instance; private config; private constructor(); static getInstance(): ConfigManager; private getDefaultConfig; configure(config: PluginConfig): void; private validateConfig; get<K extends keyof Required<PluginConfig>>(key: K): Required<PluginConfig>[K]; set<K extends keyof Required<PluginConfig>>(key: K, value: Required<PluginConfig>[K]): void; getAll(): Required<PluginConfig>; isConfigured(): boolean; }