(compilerOptions: CompilerOptions, projectRoot: string): ImportResolver import {createDefaultResolver} from 'svelte-docinfo/dep-resolver.js'; Create the default ImportResolver (TypeScript + tsconfig).
Uses ts.resolveModuleName against ts.sys directly — no ts.Program is
built. Identity is a fresh symbol per call, so each session that constructs
its own default gets a unique cache scope. Multiple sessions sharing one
resolver instance share the cache scope (correct, since resolver state is
shared too).
ts.resolveModuleName cannot resolve real .svelte files (no compiler
option teaches it the extension), so relative and absolute .svelte
specifiers — with or without the extension written — fall back to manual
filesystem resolution against fromFile. Non-relative .svelte specifiers
(tsconfig paths aliases, package subpaths) stay unresolved; supply a
custom resolveImport for those setups.
compilerOptions
parsed tsconfig (from loadTsconfig)
CompilerOptionsprojectRoot
absolute project root for the module-resolution cache
stringreturns
ImportResolver