import { NativeModule, requireOptionalNativeModule } from 'expo'; /** * What the system did with an install: `installed` (rarely seen: updating ourselves ends this process), * `needs_user` (a quiet install wasn't allowed; it has to be started from the app), `waiting` (the system's * confirmation screen is showing), `cancelled`, or `failed`. */ export type InstallStatus = 'installed' | 'needs_user' | 'waiting' | 'cancelled' | 'failed'; type Events = { onProgress: (event: { received: number; total: number }) => void; onInstallStatus: (event: { status: InstallStatus; message: string | null }) => void; }; declare class MusicshareUpdaterModule extends NativeModule { /** Delete downloaded updates (once installed, or no longer wanted). */ clearDownloads(): void; /** This build's versionName, e.g. "1.1.0". */ currentVersion(): string; /** Download to the app's cache and check the SHA-256; resolves with the file's path. Reuses an earlier complete download. */ download(url: string, sha256: string, fileName: string): Promise; /** * Hand the APK to the system installer. `interactive` shows the system's confirmation when it's needed; * otherwise only a quiet install is tried. The outcome arrives as onInstallStatus. */ install(path: string, interactive: boolean): Promise; } /** Android only; null elsewhere and in Expo Go. */ export default requireOptionalNativeModule('MusicshareUpdater');