* 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)
| 3099 | * and an enum, a class or an interface takes the rest as its `::` members. |
| 3100 | */ |
| 3101 | function typeMemberIn(file: string, scope: string[], path: string[], context: ResolutionContext): Node | undefined { |
| 3102 | const [name, ...rest] = path; |
| 3103 | if (name === undefined) return undefined; |
| 3104 | if (rest.length > 0 && hasNamespace(file, [...scope, name].join('.'), context)) { |
| 3105 | return typeMemberIn(file, [...scope, name], rest, context); |
| 3106 | } |
| 3107 | const declared = declarationsIn(file, scope, name, context); |
| 3108 | if (rest.length === 0) return declared[0]; |
| 3109 | const container = declared.find((n) => STATIC_MEMBER_CONTAINERS.has(n.kind)); |
| 3110 | return container ? containerMember(container, rest, context) : undefined; |
| 3111 | } |
| 3112 | |
| 3113 | /** An enum's, a class's or an interface's member at `path` (`Kind::Line`), in the container's own file. */ |
| 3114 | function containerMember(container: Node, path: string[], context: ResolutionContext): Node | undefined { |
no test coverage detected