* The member of a namespace the project declares global (`Express.User`, an * interface in `declare global { namespace Express { … } }`): a declaration of * the reference's name directly in such a block. A test's or a fixture's * globals reach its tests only.
(namespace: string, ref: UnresolvedRef, context: ResolutionContext)
| 3183 | * globals reach its tests only. |
| 3184 | */ |
| 3185 | function globalTypeMember(namespace: string, ref: UnresolvedRef, context: ResolutionContext): Node | undefined { |
| 3186 | const fromTest = isTestFile(ref.filePath); |
| 3187 | return context.getNodesByName(ref.referenceName) |
| 3188 | .filter((n) => { |
| 3189 | if (!TS_JS_FILE.test(n.filePath) || n.qualifiedName !== n.name || !MEMBER_DECLARATION_KINDS.has(n.kind)) return false; |
| 3190 | if (!fromTest && isTestFile(n.filePath)) return false; |
| 3191 | const block = innermostBlock(n, namespaceBlocks(n.filePath, context)); |
| 3192 | return block?.global === true && block.path === namespace; |
| 3193 | }) |
| 3194 | .sort(typesFirst)[0]; |
| 3195 | } |
| 3196 | |
| 3197 | /** |
| 3198 | * What `path` names in `file`, from the namespace `scope` (the file's top |
no test coverage detected