export interface LoadedModuleSnapshot { readonly name: string; readonly packageJsonPath: string; readonly version?: string; readonly mtimeMs?: number; } export interface ModuleFreshnessDiagnostic { readonly name: string; readonly loadedVersion?: string; readonly currentVersion?: string; /** True only when both mtimes are known and genuinely differ -- never a * guess from version alone (a version string can stay identical across * a same-version reinstall that still replaced the file, and not every * package bumps a version for a local/dev iteration). */ readonly stale: boolean; } /** * Resolves `name`'s real installed package.json via Node's own module * resolution (see smoke.ts's resolveDependencyModulesDir -- correct for * both a nested and a hoisted layout, never executes anything) starting * from `fromDir`, then records its version/mtime. undefined when `name` * isn't resolvable from here at all -- never thrown, so one unresolvable * watched name never prevents capturing the rest. */ export declare function captureLoadedModule(fromDir: string, name: string): LoadedModuleSnapshot | undefined; /** Bulk capture, skipping (not failing on) any name that isn't resolvable. */ export declare function captureLoadedModules(fromDir: string, names: readonly string[]): LoadedModuleSnapshot[]; export declare function checkModuleFreshness(snapshot: LoadedModuleSnapshot): ModuleFreshnessDiagnostic; export declare function checkModuleFreshnessAll(snapshots: readonly LoadedModuleSnapshot[]): ModuleFreshnessDiagnostic[]; /** The exact set of names worth watching for a long-running process: its * own direct runtime dependencies (package.json's "dependencies" field) -- * the ones a static top-level import actually loads once at process start. * devDependencies/peerDependencies are never loaded by the running process * itself, so watching them would only ever report false staleness. Bounded * the same way readPackageDeclarations elsewhere in this codebase bounds * an untrusted-shape read -- never throws on a malformed package.json, * just reports nothing to watch. */ export declare function ownRuntimeDependencyNames(packageJsonPath: string, maxNames?: number): string[]; //# sourceMappingURL=module-freshness.d.ts.map