/**
* Standalone utility for reading and decoding a single document from a file.
*
* Unlike collection-level loading, this function has no `{ id: string }` constraint —
* it works with any Schema. Useful for one-off config reads, CLI tools, etc.
*/
import { Effect, Schema } from "effect";
import { ValidationError } from "../errors/crud-errors.js";
import { type SerializationError, StorageError, type UnsupportedFormatError } from "../errors/storage-errors.js";
import { SerializerRegistry } from "../serializers/serializer-service.js";
import { StorageAdapter } from "./storage-service.js";
/**
* Options for readDocument.
*/
export interface ReadDocumentOptions {
/**
* Explicit serialization format override.
* When provided, this format is used instead of inferring from the file extension.
*/
readonly format?: string;
}
/**
* Read a file, deserialize it, and decode through a Schema.
*
* Flow:
* 1. Resolve format (option or file extension)
* 2. Read raw content via StorageAdapter
* 3. Deserialize via SerializerRegistry
* 4. Decode through Schema.decodeUnknown
*
* @param filePath - Path to the file to read
* @param schema - Effect Schema to decode the document through
* @param options - Optional configuration (format override)
*/
export declare const readDocument: (filePath: string, schema: Schema.Codec, options?: ReadDocumentOptions) => Effect.Effect;
//# sourceMappingURL=read-document.d.ts.map