MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / blockDeclaring

Function blockDeclaring

src/resolution/ambient-modules.ts:878–881  ·  view source on GitHub ↗

The `declare module` block of a declaration file whose own level declares `node`, if any.

(node: Node, context: ResolutionContext)

Source from the content-addressed store, hash-verified

876
877/** The `declare module` block of a declaration file whose own level declares `node`, if any. */
878function blockDeclaring(node: Node, context: ResolutionContext): AmbientModule | undefined {
879 if (!isBlockLevel(node) || !DECLARATION_FILE.test(node.filePath)) return undefined;
880 return scanned(context).byFile.get(node.filePath)?.find((mod) => inBlock(node, mod));
881}
882
883/**
884 * The declarations at the own level of declaration files' `declare module 'x'`

Callers 1

Calls 4

isBlockLevelFunction · 0.85
inBlockFunction · 0.85
scannedFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected