import type * as fs from 'node:fs'; import type { EnvironmentModuleNode, RunnableDevEnvironment } from 'vite'; import type { TypedEventEmitter } from '../../types/typed-emitter.js'; export type LoaderEvents = { 'file-add': (msg: [path: string, stats?: fs.Stats | undefined]) => void; 'file-change': (msg: [path: string, stats?: fs.Stats | undefined]) => void; 'file-unlink': (msg: [path: string, stats?: fs.Stats | undefined]) => void; 'hmr-error': (msg: { type: 'error'; err: { message: string; stack: string; }; }) => void; }; export type ModuleLoaderEventEmitter = TypedEventEmitter; export interface ModuleLoader { import: (src: string) => Promise>; resolveId: (specifier: string, parentId: string | undefined) => Promise; getModuleById: (id: string) => EnvironmentModuleNode | undefined; getModulesByFile: (file: string) => Set | undefined; getModuleInfo: (id: string) => ModuleInfo | null; eachModule(callbackfn: (value: EnvironmentModuleNode, key: string, map: Map) => void): void; invalidateModule(mod: EnvironmentModuleNode): void; fixStacktrace: (error: Error) => void; clientReload: () => void; webSocketSend: (msg: any) => void; isHttps: () => boolean; events: TypedEventEmitter; getSSREnvironment: () => RunnableDevEnvironment; } export interface ModuleInfo { id: string; meta?: Record; } export declare function createLoader(overrides: Partial): ModuleLoader;