import type { Stats } from 'node:fs'; import type { LifecycleContext } from '../types'; import type { MarkdocError } from '../../types/index.js'; export type FileInfo = { relativePath: string; realRelativePath: string; isVirtual: boolean; hash: string | undefined; }; /** * Information about fs acccess operations. * Type of operation. * load - loading file content using our Cache loaders * read - reading file content * exists - checking if file exists * readdir - reading directory content * scan - scanning directory content deeply with support of regexp to match some specific files * dependencies - array of string dependencies provided as an argument react-style */ export type AccessRecord = { type: 'load'; loaderId: string; resource: string; hash: string; } | { type: 'read' | 'exists'; path: string; hash: string; } | { type: 'scan'; hash: string; pattern?: RegExp; }; export type LoadResult = { /** * Hash of the file content combined with all the fs operations that were used to get this content. */ compoundHash: string; data: T; }; export type LoaderFn = (resource: string, context: LifecycleContext, reportError: (error: Error | MarkdocError) => void) => Promise; export type FsEvent = { event: 'add' | 'change' | 'unlink'; path: string; stats?: Stats; } | { event: 'code-updated'; }; //# sourceMappingURL=fs.d.ts.map