@kernlang/core 3.1.7 → 3.1.8

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,38 @@
1
+ /**
2
+ * TypeScript → .kern Importer
3
+ *
4
+ * Reads TypeScript source and produces .kern output by recognizing structural patterns:
5
+ * type aliases, interfaces, functions, classes (→ service/error), constants, imports.
6
+ * Function/method bodies become <<<>>> handler blocks.
7
+ * JSDoc comments become doc nodes.
8
+ *
9
+ * Uses the TypeScript compiler API (already a dependency) — no ts-morph needed.
10
+ */
11
+ export interface ImportResult {
12
+ /** The generated .kern source */
13
+ kern: string;
14
+ /** TS constructs that couldn't be mapped */
15
+ unmapped: string[];
16
+ /** Stats about what was imported */
17
+ stats: {
18
+ types: number;
19
+ interfaces: number;
20
+ functions: number;
21
+ classes: number;
22
+ imports: number;
23
+ constants: number;
24
+ enums: number;
25
+ components: number;
26
+ };
27
+ }
28
+ /**
29
+ * Import TypeScript source code and produce .kern output.
30
+ *
31
+ * Recognizes: imports, type aliases, interfaces, enums, functions, classes (→ service/error), constants.
32
+ * Function/method bodies become <<<>>> handler blocks.
33
+ * JSDoc comments become doc nodes.
34
+ *
35
+ * @param tsSource - TypeScript source code
36
+ * @param fileName - Optional filename for better error messages
37
+ */
38
+ export declare function importTypeScript(tsSource: string, fileName?: string): ImportResult;