import type { CustomRouteHandler } from './ui-http-server.js'; export declare const APP_UPDATE_MANIFEST_PATH = "/api/app-update/manifest.json"; export interface GhReleaseAsset { name: string; size: number; /** GitHub-computed content digest, `sha256:`. Absent/null on very old assets. */ digest?: string | null; browser_download_url: string; } export interface GhRelease { tag_name: string; html_url: string; published_at: string; body?: string | null; assets: GhReleaseAsset[]; } export interface AppUpdateAsset { name: string; os: 'linux' | 'windows' | 'macos' | 'android'; /** Normalized arch: x86_64 / aarch64 / universal. */ arch: string; kind: 'appimage' | 'deb' | 'rpm' | 'nsis' | 'dmg' | 'apk'; /** Direct GitHub CDN download URL. */ url: string; size: number; /** SHA-256 (hex) of the asset bytes, from the GitHub asset digest. */ sha256: string; } export interface AppUpdateManifest { version: string; releaseUrl: string; publishedAt: string; notes: string; assets: AppUpdateAsset[]; } export declare function parseAppAssetName(name: string): { version: string; os: AppUpdateAsset['os']; arch: string; kind: AppUpdateAsset['kind']; } | null; /** * Pick the newest release that (a) is a `server-v*` release, (b) carries at least one installable * app asset, and (c) is not newer than this server. Returns the manifest for it, or null. */ export declare function buildAppUpdateManifest(releases: GhRelease[], serverVersion: string): AppUpdateManifest | null; export interface AppUpdateRouteOptions { serverVersion?: string; fetchReleases?: () => Promise; ttlMs?: number; now?: () => number; } /** * Build the app-update custom-route map. The manifest is computed from the GitHub release list, * cached for `ttlMs`; a failed (re)fetch is also cached for the TTL (no GitHub hammering) and falls * back to the last good manifest, else `{}` — the shell treats a version-less body as "no update". */ export declare function createAppUpdateRoutes(opts?: AppUpdateRouteOptions): Record;