import { default as React } from 'react'; import { FileNode, ClipboardItem } from '../../types'; import { RecycleBinItem } from './utils/persistence'; /** How the built-in filesystem combines with injected content (#77). */ export type FileSystemMode = 'merge' | 'replace'; interface FileSystemContextType { fs: { root: FileNode; }; clipboard: ClipboardItem | null; getFile: (path: string[]) => FileNode | null; checkAccess: (node: FileNode, passwordInput: string) => boolean; /** Persistently clear a node's `locked` flag (host/scenario-driven unlock). */ unlockNode: (path: string[]) => void; updateFile: (path: string[], updates: Partial) => void; createFile: (parentPath: string[], fileName: string, type?: 'file' | 'folder', properties?: Partial) => void; createFolder: (parentPath: string[], folderName: string) => void; renameFile: (parentPath: string[], oldName: string, newName: string) => void; deleteFile: (parentPath: string[], fileName: string) => void; deleteFolder: (parentPath: string[], folderName: string) => void; moveFile: (sourcePath: string[], fileName: string, destinationPath: string[], newName?: string) => void; copyFile: (sourcePath: string[], fileName: string, destinationPath: string[], newName?: string) => void; copyToClipboard: (sourcePath: string[], fileName: string | string[]) => void; cutFile: (sourcePath: string[], fileName: string | string[]) => void; pasteFile: (destinationPath: string[]) => boolean; emptyRecycleBin: () => void; restoreFromRecycleBin: (fileName: string) => void; searchFiles: (query: string, startPath?: string[]) => Array<{ path: string[]; name: string; type: string; icon?: string; }>; getFileProperties: (path: string[], fileName: string) => { name: string; type: string; /** Byte count for files (0 for folders). Format for display in the UI layer. */ sizeBytes: number; /** Child object count for folders; null for files. */ childCount: number | null; icon?: string; /** Authored ISO timestamp, or null when the metadata is unknown. */ created: string | null; modified: string | null; accessed: string | null; locked: boolean; broken: boolean; } | null; saveFsState: () => void; resetToDefault: () => void; /** Deep clone of the live filesystem tree (with contents) for snapshots (#117). */ getFsSnapshot: () => { root: FileNode; }; /** Deep clone of the live recycle bin contents (#117). */ getRecycleBinItems: () => Record; /** * Replace this instance's persisted filesystem + recycle bin with a snapshot * (clears storage first, then writes). Caller reloads to rehydrate (#117). */ loadFsSnapshot: (tree: { root: FileNode; }, recycleBin: Record) => Promise; /** * Replace the live tree in memory (state + persist) WITHOUT a reload (#207). * Unlike {@link loadFsSnapshot}, this re-renders synchronously — the rehearsal * engine uses it to restore the baseline filesystem when seeking backward. */ applyFsSnapshotInMemory: (tree: { root: FileNode; }) => void; uploadTextFile: (parentPath: string[], fileName: string, content: string) => void; downloadTextFile: (path: string[], fileName: string) => void; } export declare const useFileSystem: () => FileSystemContextType; /** Optional variant for embeddable leaf apps that also render in isolation tests. */ export declare const useOptionalFileSystem: () => FileSystemContextType | undefined; export declare const FileSystemProvider: React.FC<{ children: React.ReactNode; customFileSystem?: Record; cultureFileSystem?: Record; cultureKey?: string; /** 'merge' (default) layers custom content over the built-ins; 'replace' * keeps only OS scaffolding so the consumer owns the whole tree (#77). */ fileSystemMode?: FileSystemMode; /** Authored recycle-bin records with stable original paths and timestamps (#282). */ seededRecycleBin?: Record; }>; export {};