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

Function declarationSignature

packages/tools/jsdocs/src/Jsdocs.ts:3067–3089  ·  view source on GitHub ↗
(
  name: string,
  bucket: ExportBucket,
  node: ts.Node,
  checker: ts.TypeChecker,
  cwd: string
)

Source from the content-addressed store, hash-verified

3065}
3066
3067function declarationSignature(
3068 name: string,
3069 bucket: ExportBucket,
3070 node: ts.Node,
3071 checker: ts.TypeChecker,
3072 cwd: string
3073): string | null {
3074 if (ts.isVariableStatement(node)) {
3075 const declaration = node.declarationList.declarations.find((item) =>
3076 ts.isIdentifier(item.name) && item.name.text === name
3077 )
3078 if (declaration === undefined) return null
3079 const symbol = checker.getSymbolAtLocation(declaration.name)
3080 return symbol === undefined ? null : symbolSignature(name, bucket, symbol, declaration.name, checker, cwd)
3081 }
3082 const nameNode = ts.isFunctionDeclaration(node) || ts.isClassDeclaration(node) || ts.isInterfaceDeclaration(node) ||
3083 ts.isTypeAliasDeclaration(node)
3084 ? node.name
3085 : undefined
3086 if (nameNode === undefined) return null
3087 const symbol = checker.getSymbolAtLocation(nameNode)
3088 return symbol === undefined ? null : symbolSignature(name, bucket, symbol, nameNode, checker, cwd)
3089}
3090
3091function exportSpecifierSignature(
3092 name: string,

Callers 1

parseSourceFileDocsFunction · 0.85

Calls 2

symbolSignatureFunction · 0.85
findMethod · 0.65

Tested by

no test coverage detected