( name: string, module: SourceModule )
| 2621 | |
| 2622 | // e.g. the `User` of "./types.ts" for `import type { User } from "./types.ts"` |
| 2623 | private typeImportTargetOf( |
| 2624 | name: string, |
| 2625 | module: SourceModule |
| 2626 | ): ImportTarget | undefined { |
| 2627 | const imported = importedNameOf(module, name) |
| 2628 | if (!imported) return |
| 2629 | const [specifier, importedName] = imported |
| 2630 | // a type carries no value, so a host asks no bundler to resolve it |
| 2631 | const target = this.resolve(specifier, module, () => false) |
| 2632 | if (target instanceof SourceModule) { |
| 2633 | return importedName === "*" ? |
| 2634 | { kind: "namespace", module: target } |
| 2635 | : this.exportOf(target, importedName) |
| 2636 | } |
| 2637 | if (target.kind !== "arktypeNamespace") return |
| 2638 | return importedName === "*" ? target : arktypeExportOf(target, importedName) |
| 2639 | } |
| 2640 | |
| 2641 | // e.g. `opts: EnvOptions` in index.d.ts for `createEnv(opts)` in index.js, |
| 2642 | // which tsc or a bundler wrote beside it, so a package's built output is |
no test coverage detected