import type { DirEntry, FileInfo, FileWatcher, RuntimeAdapter } from "../platform/adapters/base.js"; import { type PathValidationPolicyOptions } from "./path-validation.js"; export declare const SECURITY_CONTEXTS: readonly ["user-input", "static-serving", "build", "internal", "route-discovery", "module-loading"]; export type SecurityContext = (typeof SECURITY_CONTEXTS)[number]; export declare function isSecurityContext(value: unknown): value is SecurityContext; export interface SecureFsConfig { baseDir: string; adapter: RuntimeAdapter; context?: SecurityContext; contextOptions?: ContextOptions; validationOptions?: Partial>; onSecurityEvent?: (event: SecurityEvent) => void; } export interface SecurityEvent { type: "validation-failed" | "validation-passed" | "operation-blocked"; operation: string; path: string; error?: string; code?: string; timestamp: Date; } interface ContextOptions { readonly allowedImportDirs?: string[]; } export declare class SecureFs { private readonly config; private readonly fileSystem; private readonly validationOptions; readonly readFileBytesBounded?: (path: string, byteLimit: number) => Promise; readonly readFileBytesWithinLimit?: (path: string, byteLimit: number) => Promise; readonly readFileSnapshotWithinLimit?: (path: string, byteLimit: number) => Promise; readonly maxWholeFileReadBytes?: number; constructor(config: SecureFsConfig); private buildValidationOptions; private emitValidationEvent; private throwIfInvalid; private validatePathForOperation; private getCanonicalPathOrThrow; readFile(path: string): Promise; readFileBytes(path: string): Promise; writeFile(path: string, content: string): Promise; stat(path: string): Promise; mkdir(path: string, options?: { recursive?: boolean; }): Promise; remove(path: string, options?: { recursive?: boolean; }): Promise; exists(path: string): Promise; readDir(path: string): AsyncIterable; makeTempDir(prefix: string): Promise; watch(paths: string | string[], options?: { recursive?: boolean; signal?: AbortSignal; }): FileWatcher; } export { SECURITY_VIOLATION } from "../errors/index.js"; export declare function createSecureFs(config: SecureFsConfig): SecureFs; export declare function wrapAdapterWithSecurity(adapter: RuntimeAdapter, options: Omit): RuntimeAdapter & { secureFs: SecureFs; }; //# sourceMappingURL=secure-fs.d.ts.map