macroforge 0.1.78 → 0.1.80

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,132 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ export function Clone(): void;
5
+
6
+ export function Debug(): void;
7
+
8
+ export function Default(): void;
9
+
10
+ export function Derive(): void;
11
+
12
+ export function Deserialize(): void;
13
+
14
+ export function Hash(): void;
15
+
16
+ export class NativeMapper {
17
+ private constructor();
18
+ free(): void;
19
+ [Symbol.dispose](): void;
20
+ expandedToOriginal(pos: number): number | undefined;
21
+ generatedBy(pos: number): string | undefined;
22
+ isEmpty(): boolean;
23
+ isInGenerated(pos: number): boolean;
24
+ mapSpanToExpanded(start: number, length: number): any;
25
+ mapSpanToOriginal(start: number, length: number): any;
26
+ originalToExpanded(pos: number): number;
27
+ }
28
+
29
+ export class NativePlugin {
30
+ free(): void;
31
+ [Symbol.dispose](): void;
32
+ expandSync(code: string, filepath: string, options: any): any;
33
+ getMapper(filepath: string): NativeMapper | undefined;
34
+ log(_message: string): void;
35
+ mapDiagnostics(filepath: string, diags: any): any;
36
+ constructor();
37
+ processFile(filepath: string, code: string, options: any): any;
38
+ transformSync(code: string, filepath: string): any;
39
+ }
40
+
41
+ export class NativePositionMapper {
42
+ free(): void;
43
+ [Symbol.dispose](): void;
44
+ mapToExpanded(_line: number, _column: number): any;
45
+ mapToOriginal(_line: number, _column: number): any;
46
+ constructor(_mapping: any);
47
+ }
48
+
49
+ export function Ord(): void;
50
+
51
+ export function PartialEq(): void;
52
+
53
+ export function PartialOrd(): void;
54
+
55
+ export function Serialize(): void;
56
+
57
+ export function __macroforgeDebugDescriptors(): any;
58
+
59
+ export function __macroforgeDebugGetModules(): any;
60
+
61
+ export function __macroforgeDebugLookup(module: string, name: string): string;
62
+
63
+ export function __macroforgeGetMacroNames(): any;
64
+
65
+ export function __macroforgeGetManifest(): any;
66
+
67
+ export function __macroforgeIsMacroPackage(): boolean;
68
+
69
+ export function __macroforgeRunClone(context_json: string): string;
70
+
71
+ export function __macroforgeRunDebug(context_json: string): string;
72
+
73
+ export function __macroforgeRunDefault(context_json: string): string;
74
+
75
+ export function __macroforgeRunDeserialize(context_json: string): string;
76
+
77
+ export function __macroforgeRunHash(context_json: string): string;
78
+
79
+ export function __macroforgeRunOrd(context_json: string): string;
80
+
81
+ export function __macroforgeRunPartialEq(context_json: string): string;
82
+
83
+ export function __macroforgeRunPartialOrd(context_json: string): string;
84
+
85
+ export function __macroforgeRunSerialize(context_json: string): string;
86
+
87
+ export function checkSyntax(code: string, filepath: string): any;
88
+
89
+ export function clearConfigCache(): void;
90
+
91
+ export function clearScanCache(): void;
92
+
93
+ export function expandSync(code: string, filepath: string, options: any): any;
94
+
95
+ /**
96
+ * Phase 17 — scan cache invalidation. WASM cannot access the
97
+ * filesystem, so there is no scan cache to invalidate on that
98
+ * target. These shims are here so the JS side of the plugin can
99
+ * call them uniformly across NAPI and WASM backends.
100
+ */
101
+ export function invalidateScanCacheEntry(path: string): boolean;
102
+
103
+ export function loadConfig(content: string, filepath: string): any;
104
+
105
+ export function parseImportSources(code: string, filepath: string): any;
106
+
107
+ export function scanProjectSync(root_dir: string, options: any): any;
108
+
109
+ /**
110
+ * Register JS callbacks that bridge `buildtime.fs.*` to the host
111
+ * filesystem. Called once at startup by the Vite plugin (and any
112
+ * other JS host). Subsequent calls are ignored.
113
+ */
114
+ export function setupBuildtimeFs(read_text: Function, exists: Function, list_dir: Function): void;
115
+
116
+ /**
117
+ * Register JS callbacks for resolving and running external (user-defined) macros.
118
+ *
119
+ * Required for WASM builds. The native (NAPI) build resolves external macros
120
+ * by spawning a Node subprocess, but WASM cannot spawn processes. Instead, the
121
+ * host JS environment must provide two callbacks:
122
+ *
123
+ * resolve: Given a package path, return an array of decorator names exported by that package.
124
+ *
125
+ * run: Given a JSON-serialized MacroContextIR, execute the external macro and return a JSON-serialized MacroResult.
126
+ *
127
+ * Must be called before expandSync if the source uses import macro comments.
128
+ * Does not exist on NAPI builds, so guard the call.
129
+ */
130
+ export function setupExternalMacros(resolve: Function, run: Function): void;
131
+
132
+ export function transformSync(code: string, filepath: string): any;