@wrongstack/tools 0.299.0 → 0.300.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Import extraction for languages without an AST parser.
3
+ *
4
+ * Deliberately imports only — no call or type references. An import statement
5
+ * has a rigid, line-anchored syntax that a regex reads correctly; a call site
6
+ * does not, and a regex "call graph" produces edges that look authoritative
7
+ * while being mostly wrong. Dependency edges are what the Code Atlas is built
8
+ * around, so extracting those well beats extracting everything badly.
9
+ *
10
+ * Languages with a real parser (TS/JS via the compiler API, Go and Python via
11
+ * their own `ast` modules) never reach this module.
12
+ */
13
+ import type { Ref, SymbolLang } from './schema.js';
14
+ /** Only the leading window is scanned, mirroring the generic symbol extractor. */
15
+ export declare const IMPORT_MAX_FILE_CHARS: number;
16
+ /** Upper bound on imports recorded per file. */
17
+ export declare const IMPORT_MAX_PER_FILE = 400;
18
+ /**
19
+ * The name a specifier refers to.
20
+ *
21
+ * Path-like and namespace-like specifiers need opposite treatment of the dot:
22
+ * in `engine/core.h` it introduces a file extension to strip, in
23
+ * `com.example.Helper` it is the segment separator. The presence of a path
24
+ * separator is what tells them apart.
25
+ */
26
+ export declare function lastSegment(specifier: string): string;
27
+ /** True when this language's imports are extracted here rather than by a parser. */
28
+ export declare function hasImportPatterns(lang: SymbolLang): boolean;
29
+ /**
30
+ * Extract `import` refs from source text. Never throws.
31
+ *
32
+ * Returned refs carry `fromId: 0`; the indexer rewrites it to the owning symbol.
33
+ */
34
+ export declare function extractImports(opts: {
35
+ content: string;
36
+ lang: SymbolLang;
37
+ maxImports?: number;
38
+ }): Ref[];
39
+ //# sourceMappingURL=import-extractor.d.ts.map