* What `path` names in `file`, from the namespace `scope` (the file's top * level when empty): a namespace takes the next name as a member of its own, * and an enum, a class or an interface takes the rest as its `::` members.
(file: string, scope: string[], path: string[], context: ResolutionContext)
| 3200 | * and an enum, a class or an interface takes the rest as its `::` members. |
| 3201 | */ |
| 3202 | function typeMemberIn(file: string, scope: string[], path: string[], context: ResolutionContext): Node | undefined { |
| 3203 | const [name, ...rest] = path; |
| 3204 | if (name === undefined) return undefined; |
| 3205 | if (rest.length > 0 && hasNamespace(file, [...scope, name].join('.'), context)) { |
| 3206 | return typeMemberIn(file, [...scope, name], rest, context); |
| 3207 | } |
| 3208 | const declared = declarationsIn(file, scope, name, context); |
| 3209 | if (rest.length === 0) return declared[0]; |
| 3210 | const container = declared.find((n) => STATIC_MEMBER_CONTAINERS.has(n.kind)); |
| 3211 | return container ? containerMember(container, rest, context) : undefined; |
| 3212 | } |
| 3213 | |
| 3214 | /** An enum's, a class's or an interface's member at `path` (`Kind::Line`), in the container's own file. */ |
| 3215 | function containerMember(container: Node, path: string[], context: ResolutionContext): Node | undefined { |
no test coverage detected