import { Context, type Effect } from "effect"; import type { StorageError, UnsupportedFormatError } from "../errors/storage-errors.js"; /** * Error types that can occur during storage read/write operations. * Includes StorageError for I/O failures and UnsupportedFormatError * for format validation (e.g., when allowedFormats config is set). */ export type StorageReadWriteError = StorageError | UnsupportedFormatError; export interface StorageAdapterShape { readonly read: (path: string) => Effect.Effect; readonly write: (path: string, data: string) => Effect.Effect; readonly append: (path: string, data: string) => Effect.Effect; readonly exists: (path: string) => Effect.Effect; readonly remove: (path: string) => Effect.Effect; readonly ensureDir: (path: string) => Effect.Effect; readonly watch: (path: string, onChange: () => void) => Effect.Effect void, StorageError>; readonly listDirectory: (dirPath: string) => Effect.Effect, StorageError>; readonly listRecursive: (rootPath: string) => Effect.Effect, StorageError>; readonly watchDir: (dirPath: string, onChange: (event: { readonly filename: string | null; readonly type: "add" | "change" | "remove"; }) => void) => Effect.Effect void, StorageError>; } export declare const StorageAdapter: Context.Service; export type StorageAdapter = StorageAdapterShape; //# sourceMappingURL=storage-service.d.ts.map