export type FileAccessObject = { readFile: (path: string, encoding: BufferEncoding) => Promise readFileSync: (path: string, encoding: BufferEncoding) => string existsSync: (path: string) => boolean } export type Logger = { info: (...messages: string[]) => void error: (...message: string[]) => void warn: (...message: string[]) => void log: (...message: string[]) => void } /** * Copied from rollup (kinda) * @see https://rollupjs.org/plugin-development/#this-getmoduleinfo */ export interface ModuleInfo { id: string // the id of the module, for convenience rawCode: string | null // the source code of the module, `null` if external or not yet available code: string | null // the code after transformed to correctly resolve remappings and node_module imports importedIds: string[] // the module ids statically imported by this module } /** * The result of the resolution of an import */ export type ResolvedImport = { original: string absolute: string updated: string }