MCPcopy Create free account
hub / github.com/Effect-TS/effect / parseTypeAliasDeclaration

Function parseTypeAliasDeclaration

packages/tools/docgen/src/Parser.ts:288–308  ·  view source on GitHub ↗
(ta: ast.TypeAliasDeclaration)

Source from the content-addressed store, hash-verified

286})
287
288const parseTypeAliasDeclaration = (ta: ast.TypeAliasDeclaration) =>
289 Effect.gen(function*() {
290 const doc = parseDoc(getJSDocText(ta.getJsDocs()))
291 if (shouldIgnore(doc)) {
292 return []
293 }
294 const name = ta.getName()
295 const len = ta.getTypeParameters().length
296 const type = parseType(ta)
297 const definition = ta.getTypeNode()?.getText()
298 const signature = `type ${len > 0 ? type : name} = ${definition}`
299 const position = yield* parsePosition(ta)
300 return [
301 new Domain.TypeAlias(
302 name,
303 doc,
304 signature,
305 position
306 )
307 ]
308 })
309
310const parseTypeAliasDeclarations = (typeAliases: ReadonlyArray<ast.TypeAliasDeclaration>) => {
311 const exportedTypeAliases = Array.filter(

Callers

nothing calls this directly

Calls 4

parseDocFunction · 0.85
shouldIgnoreFunction · 0.85
parseTypeFunction · 0.85
parsePositionFunction · 0.85

Tested by

no test coverage detected