MCPcopy Create free account
hub / github.com/effect-app/libs / parseTsMembers

Function parseTsMembers

repos/effect/packages/tools/jsdocs/src/Jsdocs.ts:2983–3010  ·  view source on GitHub ↗
(
  members: ts.NodeArray<ts.TypeElement | ts.ClassElement>,
  diagnostics: Array<JSDocModelDiagnostic>,
  linkContext: { readonly checker: ts.TypeChecker; readonly entry: ProgramCacheEntry; readonly cwd: string }
)

Source from the content-addressed store, hash-verified

2981
2982function symbolSignature(
2983 name: string,
2984 bucket: ExportBucket,
2985 symbol: ts.Symbol,
2986 location: ts.Node,
2987 checker: ts.TypeChecker,
2988 cwd: string
2989): string | null {
2990 if (bucket !== "value") return null
2991 const target = resolvedSymbolTarget(symbol, checker)
2992 const type = checker.getTypeOfSymbolAtLocation(target, location)
2993 if (checker.getSignaturesOfType(type, ts.SignatureKind.Call).length === 0) return null
2994 return functionSignature(name, symbol, location, checker, cwd)
2995}
2996
2997function declarationSignature(
2998 name: string,
2999 bucket: ExportBucket,
3000 node: ts.Node,
3001 checker: ts.TypeChecker,
3002 cwd: string
3003): string | null {
3004 if (ts.isVariableStatement(node)) {
3005 const declaration = node.declarationList.declarations.find((item) =>
3006 ts.isIdentifier(item.name) && item.name.text === name
3007 )
3008 if (declaration === undefined) return null
3009 const symbol = checker.getSymbolAtLocation(declaration.name)
3010 return symbol === undefined ? null : symbolSignature(name, bucket, symbol, declaration.name, checker, cwd)
3011 }
3012 const nameNode = ts.isFunctionDeclaration(node) || ts.isClassDeclaration(node) || ts.isInterfaceDeclaration(node) ||
3013 ts.isTypeAliasDeclaration(node)

Callers 2

parseMembersFromTsTypeFunction · 0.85

Calls 6

parseDocumentedTsFunction · 0.85
memberNameFunction · 0.85
parseMembersFromTsTypeFunction · 0.85
memberTypeFunction · 0.85
nodeRangeFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…