UNPKG

capacitor-native-update

Version:
73 lines (72 loc) 2.01 kB
import type { LatestVersion } from '../definitions'; /** * Manages version checking and comparison */ export declare class VersionManager { private readonly VERSION_CHECK_CACHE_KEY; private readonly CACHE_DURATION; private readonly logger; private readonly configManager; private readonly securityValidator; private preferences; private memoryCache; constructor(); /** * Initialize the version manager */ initialize(): Promise<void>; /** * Check for latest version from server */ checkForUpdates(serverUrl: string, channel: string, currentVersion: string, appId: string): Promise<LatestVersion | null>; /** * Compare two versions */ isNewerVersion(version1: string, version2: string): boolean; /** * Check if update is mandatory based on minimum version */ isUpdateMandatory(currentVersion: string, minimumVersion?: string): boolean; /** * Parse version metadata */ parseVersion(version: string): { major: number; minor: number; patch: number; prerelease?: string; build?: string; }; /** * Generate version string from components */ buildVersionString(components: { major: number; minor: number; patch: number; prerelease?: string; build?: string; }): string; /** * Check if version is compatible with native version requirements */ isCompatibleWithNativeVersion(bundleVersion: string, nativeVersion: string, compatibility?: { [key: string]: string; }): boolean; /** * Get version from cache */ private getCachedVersionInfo; /** * Cache version info */ private cacheVersionInfo; /** * Clear version cache */ clearVersionCache(): Promise<void>; /** * Check if downgrade protection should block update */ shouldBlockDowngrade(currentVersion: string, newVersion: string): boolean; }