(
file: JSDocModelFile,
imports: ParsedJSDocImports,
namespaces: ReadonlyArray<ParsedNamespace>,
namespacePath: ReadonlyArray<string>,
sourcePath: ReadonlyArray<string | number>
)
| 2114 | }) |
| 2115 | } |
| 2116 | const addNamespaces = ( |
| 2117 | file: JSDocModelFile, |
| 2118 | imports: ParsedJSDocImports, |
| 2119 | namespaces: ReadonlyArray<ParsedNamespace>, |
| 2120 | namespacePath: ReadonlyArray<string>, |
| 2121 | sourcePath: ReadonlyArray<string | number> |
| 2122 | ) => { |
| 2123 | namespaces.forEach((namespace, index) => { |
| 2124 | const nextNamespacePath = [...namespacePath, namespace.name] |
| 2125 | const namespaceApiName = nextNamespacePath.join(".") |
| 2126 | apis.push(makeApi({ |
| 2127 | file, |
| 2128 | imports, |
| 2129 | kind: "namespace", |
| 2130 | bucket: null, |
| 2131 | apiName: namespaceApiName, |
| 2132 | localName: namespace.name, |
| 2133 | signature: namespace.signature, |
| 2134 | parentApiName: namespacePath.length === 0 ? null : namespacePath.join("."), |
| 2135 | namespacePath: nextNamespacePath, |
| 2136 | memberPath: [], |
| 2137 | sourcePath: [...sourcePath, index], |
| 2138 | sourceRange: namespace.range, |
| 2139 | description: namespace.description, |
| 2140 | examples: namespace.examples, |
| 2141 | tags: namespace.tags |
| 2142 | })) |
| 2143 | namespace.declarations.forEach((declaration, declarationIndex) => { |
| 2144 | const apiName = `${namespaceApiName}.${declaration.name}` |
| 2145 | apis.push(makeApi({ |
| 2146 | file, |
| 2147 | imports, |
| 2148 | kind: "namespace-declaration", |
| 2149 | bucket: "type", |
| 2150 | apiName, |
| 2151 | localName: declaration.name, |
| 2152 | signature: declaration.signature, |
| 2153 | parentApiName: namespaceApiName, |
| 2154 | namespacePath: nextNamespacePath, |
| 2155 | memberPath: [], |
| 2156 | sourcePath: [...sourcePath, index, "declarations", declarationIndex], |
| 2157 | sourceRange: declaration.range, |
| 2158 | description: declaration.description, |
| 2159 | examples: declaration.examples, |
| 2160 | tags: declaration.tags |
| 2161 | })) |
| 2162 | addMembers(file, imports, declaration.members, apiName, nextNamespacePath, [], [ |
| 2163 | ...sourcePath, |
| 2164 | index, |
| 2165 | "declarations", |
| 2166 | declarationIndex |
| 2167 | ]) |
| 2168 | }) |
| 2169 | addNamespaces(file, imports, namespace.namespaces, nextNamespacePath, [...sourcePath, index, "namespaces"]) |
| 2170 | }) |
| 2171 | } |
| 2172 | for (const file of files) { |
| 2173 | if (file.imports === undefined) continue |
no test coverage detected