/** Bitmap formats the folder slideshow accepts (case-insensitive, no SVG). */ export declare const IMAGE_EXTENSIONS: readonly ["png", "jpg", "jpeg", "webp", "gif", "bmp"]; /** One accepted extension. */ export type ImageExtension = (typeof IMAGE_EXTENSIONS)[number]; /** One cached image entry (also the shape persisted in the settings blob). */ export interface FolderImage { /** Absolute host path — the key the slideshow records as used. */ path: string; /** File name (display). */ name: string; /** Path relative to the scanned root, with `/` separators (sort key). */ rel: string; /** Size in bytes at scan time. */ size: number; /** Modification time in ms at scan time (cache-busting token). */ mtimeMs: number; } /** The extension of `file` when it is an accepted bitmap, else undefined. */ export declare function imageExtension(file: string): ImageExtension | undefined; /** The HTTP content type for an accepted bitmap, else undefined. */ export declare function imageContentType(file: string): string | undefined; /** * Whether `candidate` is the root itself or lives below it. Comparison is * prefix-on-path-separator, so `/pics2` never passes as inside `/pics`; * Windows paths are compared case-insensitively. */ export declare function isInsideRoot(root: string, candidate: string, caseInsensitive?: boolean): boolean; /** One directory entry as `readdirSync(dir, { withFileTypes: true })` reports it. */ export interface DirEntry { name: string; isDirectory(): boolean; isFile(): boolean; isSymbolicLink(): boolean; } /** The slice of `node:fs` the scan uses. */ export interface ScanIo { /** Directory entries with their type, as `readdirSync(dir, { withFileTypes: true })` returns them. */ readdirSync(dir: string): ReadonlyArray; /** File metadata, as `statSync(path)` returns it. */ statSync(path: string): { isFile(): boolean; size: number; mtimeMs: number; }; /** Canonical absolute path, as `realpathSync(path)` returns it. */ realpathSync(path: string): string; } /** Scan bounds: a whole drive of wallpapers must not stall the host. */ export interface ScanLimits { /** Maximum images returned (and therefore cached). */ maxImages: number; /** Maximum directory entries examined before the scan stops early. */ maxScan: number; /** Maximum recursion depth below the root (recursive scans only). */ maxDepth: number; } /** Default scan bounds. */ export declare const SCAN_LIMITS: ScanLimits; /** One scan result. */ export interface ScanResult { /** Canonical absolute root the returned paths live under. */ root: string; /** Image entries sorted by `rel` (natural, case-insensitive). */ images: FolderImage[]; /** Whether a bound stopped the scan before the folder was exhausted. */ truncated: boolean; } /** Natural-order comparator shared by the host scan and the browser's re-sort. */ export declare function compareRel(left: string, right: string): number; /** * Collect the accepted bitmap files under `root`. * * Symlinks are skipped outright (they can escape the root and form loops), so * every returned path is a real file directly below the canonical root. * @param root - directory picked by the user (any form `path.resolve` accepts). * @param recursive - descend into subdirectories. * @param io - filesystem face (tests pass a fake). * @param limits - scan bounds. * @returns the canonical root plus the sorted image list and truncation flag. * @throws {Error} when the root itself cannot be resolved or read. */ export declare function scanImageFolder(root: string, recursive: boolean, io: ScanIo, limits?: ScanLimits): ScanResult; //# sourceMappingURL=folder.d.ts.map