GeoLeaf Core API - v3.0.0
    Preparing search index...
    CacheManager: {
        _config: CacheManagerConfig;
        _cachingProfiles: Set<string>;
        init(options?: CacheManagerConfig): void;
        cacheProfile(
            profileId: string,
            options?: CacheProfileOptions,
        ): Promise<CacheResult>;
        cancelDownload(): void;
        isDownloading(): boolean;
        _loadProfileConfig(profileId: string): Promise<unknown>;
        _saveManifest(profileId: string, result: CacheResult): Promise<void>;
        _enforceCacheQuota(): Promise<void>;
        clearProfile(profileId: string): Promise<number>;
        clearCache(profileId: string): Promise<number>;
        estimateProfileSize(
            profileId: string,
        ): Promise<
            {
                totalSize: number;
                totalSizeFormatted: string;
                byType?: unknown;
                resourceCounts?: unknown;
            },
        >;
        _fallbackEstimation(
            resources: EnumerateResource[],
        ): {
            totalSize: number;
            totalSizeFormatted: string;
            resourceCounts: { total: number };
        };
        _formatBytes(bytes: number, decimals?: number): string;
        listCachedProfiles(): Promise<string[]>;
        isProfileCached(profileId: string): Promise<boolean>;
        getStorageQuota(): Promise<
            {
                usage: number;
                quota: number;
                percentage: number;
                available?: number;
            },
        >;
        getCacheStatus(profileId: string): Promise<CacheStatusResult>;
        saveLayerSelection(
            profileId: string,
            selection: LayerSelection,
        ): Promise<void>;
        loadLayerSelection(profileId: string): Promise<LayerSelection | null>;
    } = ...

    Type Declaration

    • _config: CacheManagerConfig
    • _cachingProfiles: Set<string>
    • init: function
    • cacheProfile: function
    • cancelDownload: function
      • Interrompt le téléchargement en cours, et le DIT.

        🛑 L'ÉVÉNEMENT MANQUAIT, ET CE N'ÉTAIT PAS UN ÉCOUTEUR MORT MAIS UN BUG. Mesuré à la clôture de S3c : geoleaf:cache:cancelled avait deux écouteurs et zéro émetteur. Le pré-vol E3.5 avait relevé le même chiffre et en avait tiré « l'interface l'écoute pour rien » — vrai sur la mesure, faux sur le geste.

        Ce que fait l'écouteur (handleCancelled, offline-ui) : il remet la barre de progression à zéro, réactive le bouton et rend la main. Sans émetteur, un utilisateur qui annule voit « ⏹️ Stopping… » indéfiniment, bouton désactivé, sans aucun moyen de relancer autre chose qu'un rechargement de page. L'écouteur avait raison ; c'est l'émetteur qui manquait.

        ⚠️ Émis ici et non dans Downloader : c'est l'orchestrateur qui possède le cycle de vie d'un téléchargement de profil, et Downloader.cancelDownload() est aussi appelé par des chemins internes. Un émetteur par intention, pas par mécanisme.

        Returns void

    • isDownloading: function
    • _loadProfileConfig: function
    • _saveManifest: function
    • _enforceCacheQuota: function
      • Enforces the configured maxCacheBytes budget over the IndexedDB layer/tile cache by evicting least-recently-cached records. No-op when the budget is disabled (0/missing) or IndexedDB is unavailable. Emits geoleaf:cache:evicted (detail = eviction summary) when records are removed. Failures are swallowed — eviction must never break a successful download.

        Returns Promise<void>

    • clearProfile: function
    • clearCache: function
    • estimateProfileSize: function
      • Parameters

        • profileId: string

        Returns Promise<
            {
                totalSize: number;
                totalSizeFormatted: string;
                byType?: unknown;
                resourceCounts?: unknown;
            },
        >

    • _fallbackEstimation: function
      • Parameters

        • resources: EnumerateResource[]

        Returns {
            totalSize: number;
            totalSizeFormatted: string;
            resourceCounts: { total: number };
        }

    • _formatBytes: function
    • listCachedProfiles: function
    • isProfileCached: function
    • getStorageQuota: function
      • Returns Promise<
            { usage: number; quota: number; percentage: number; available?: number },
        >

    • getCacheStatus: function
    • saveLayerSelection: function
    • loadLayerSelection: function