Spaces:
Sleeping
Sleeping
File size: 1,626 Bytes
df9fdc8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | import type { Stats } from "node:fs";
import type { RepoType, RepoId } from "../types/public";
export declare function getHFHubCachePath(): string;
export declare const REPO_ID_SEPARATOR: string;
export declare function getRepoFolderName({ name, type }: RepoId): string;
export interface CachedFileInfo {
path: string;
/**
* Underlying file - which `path` is symlinked to
*/
blob: {
size: number;
path: string;
lastModifiedAt: Date;
lastAccessedAt: Date;
};
}
export interface CachedRevisionInfo {
commitOid: string;
path: string;
size: number;
files: CachedFileInfo[];
refs: string[];
lastModifiedAt: Date;
}
export interface CachedRepoInfo {
id: RepoId;
path: string;
size: number;
filesCount: number;
revisions: CachedRevisionInfo[];
lastAccessedAt: Date;
lastModifiedAt: Date;
}
export interface HFCacheInfo {
size: number;
repos: CachedRepoInfo[];
warnings: Error[];
}
export declare function scanCacheDir(cacheDir?: string | undefined): Promise<HFCacheInfo>;
export declare function scanCachedRepo(repoPath: string): Promise<CachedRepoInfo>;
export declare function scanRefsDir(refsPath: string, refsByHash: Map<string, string[]>): Promise<void>;
export declare function scanSnapshotDir(revisionPath: string, cachedFiles: CachedFileInfo[], blobStats: Map<string, Stats>): Promise<void>;
export declare function getBlobStat(blobPath: string, blobStats: Map<string, Stats>): Promise<Stats>;
export declare function parseRepoType(type: string): RepoType;
//# sourceMappingURL=cache-management.d.ts.map |