(module: SourceModule)
| 2662 | |
| 2663 | // the .d.ts beside a JS module, where its build wrote one |
| 2664 | private declarationsOf(module: SourceModule): SourceModule | undefined { |
| 2665 | if (!/\.[cm]?jsx?$/.test(module.id)) return |
| 2666 | const id = module.id.replace(/\.([cm]?)jsx?$/, ".d.$1ts") |
| 2667 | let declarations = this.declarationsById[id] |
| 2668 | if (declarations === undefined) { |
| 2669 | const source = this.host.readFile(id) |
| 2670 | declarations = this.declarationsById[id] = |
| 2671 | source === undefined ? null : ( |
| 2672 | new SourceModule(id, source, this.pathOf(id)) |
| 2673 | ) |
| 2674 | } |
| 2675 | return declarations ?? undefined |
| 2676 | } |
| 2677 | |
| 2678 | // a type literal or interface isn't a Type, though a member typed |
| 2679 | // `unknown` may hold one, which reads off it are as off a parameter |
no test coverage detected