import { type OperationResult } from "./types.js"; export type LocalFileEntry = { value: T; /** Absolute path of the file the value came from. */ filePath: string; }; export type SkippedFile = { file: string; error: string; }; /** * Reads every file matching `pattern` under `/`, keeping * track of which file each parsed value came from (for image resolution and * id write-back) and which files were skipped as invalid (so the user hears * about them instead of silently losing them). */ export declare function readLocalFiles(options: { directory: string; name: string; pattern: string; parse: (content: string, filePath: string) => { value: T; } | { error: string; }; }): Promise<{ entries: LocalFileEntry[]; skipped: SkippedFile[]; }>; /** Existing file per resource id, for rename detection during writes. */ export declare function pathsById(entries: LocalFileEntry[], idOf: (value: T) => string | undefined): Map; /** * Writes pulled resources into `/`, one file per item. * Filename stems are remote-controlled (slugs, identifiers, names), so they * are sanitized and collision-suffixed instead of silently overwriting each * other. A renamed item's previous file is removed only after every write * lands, so a stem swap between two items can't delete a freshly written * file. */ export declare function writeLocalFiles(options: { directory: string; name: string; extension: string; items: T[]; idOf: (item: T) => string | undefined; stemOf: (item: T) => string | null | undefined; serialize: (item: T) => string; existingPathById: Map; }): Promise;