@ttsc/wasm 0.13.1 → 0.14.0-dev.20250530.1

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.
Files changed (159) hide show
  1. package/README.md +60 -15
  2. package/dist/ttsc.wasm +0 -0
  3. package/host/api.go +5 -4
  4. package/host/doc.go +7 -5
  5. package/host/fountain.go +505 -0
  6. package/host/host.go +64 -10
  7. package/host/plugin.go +6 -5
  8. package/lib/src/MemFSError.d.ts +15 -0
  9. package/lib/src/MemFSError.js +47 -0
  10. package/lib/src/MemFSError.js.map +1 -0
  11. package/lib/src/bootTtsc.d.ts +21 -0
  12. package/lib/src/bootTtsc.js +179 -0
  13. package/lib/src/bootTtsc.js.map +1 -0
  14. package/lib/src/createMemFS.d.ts +11 -0
  15. package/lib/src/{MemFS.js → createMemFS.js} +28 -63
  16. package/lib/src/createMemFS.js.map +1 -0
  17. package/lib/src/index.d.ts +5 -6
  18. package/lib/src/index.js +19 -8
  19. package/lib/src/index.js.map +1 -1
  20. package/lib/src/parseResult.d.ts +8 -0
  21. package/lib/src/parseResult.js +20 -0
  22. package/lib/src/parseResult.js.map +1 -0
  23. package/lib/src/structures/IBootResult.d.ts +9 -0
  24. package/lib/src/structures/IBootResult.js +3 -0
  25. package/lib/src/structures/IBootResult.js.map +1 -0
  26. package/lib/src/{instantiate.d.ts → structures/IBootTtscOptions.d.ts} +2 -12
  27. package/lib/src/structures/IBootTtscOptions.js +3 -0
  28. package/lib/src/structures/IBootTtscOptions.js.map +1 -0
  29. package/lib/src/structures/IFileStats.d.ts +23 -0
  30. package/lib/src/structures/IFileStats.js +3 -0
  31. package/lib/src/structures/IFileStats.js.map +1 -0
  32. package/lib/src/structures/IMemFSHost.d.ts +21 -0
  33. package/lib/src/structures/IMemFSHost.js +3 -0
  34. package/lib/src/structures/IMemFSHost.js.map +1 -0
  35. package/lib/src/structures/ITtscApi.d.ts +86 -0
  36. package/lib/src/structures/ITtscApi.js +3 -0
  37. package/lib/src/structures/ITtscApi.js.map +1 -0
  38. package/lib/src/structures/ITtscBuildOpts.d.ts +7 -0
  39. package/lib/src/structures/ITtscBuildOpts.js +3 -0
  40. package/lib/src/structures/ITtscBuildOpts.js.map +1 -0
  41. package/lib/src/structures/ITtscCompileResult.d.ts +11 -0
  42. package/lib/src/structures/ITtscCompileResult.js +3 -0
  43. package/lib/src/structures/ITtscCompileResult.js.map +1 -0
  44. package/lib/src/structures/ITtscDiagnostic.d.ts +14 -0
  45. package/lib/src/structures/ITtscDiagnostic.js +3 -0
  46. package/lib/src/structures/ITtscDiagnostic.js.map +1 -0
  47. package/lib/src/structures/ITtscFileQuery.d.ts +6 -0
  48. package/lib/src/structures/ITtscFileQuery.js +3 -0
  49. package/lib/src/structures/ITtscFileQuery.js.map +1 -0
  50. package/lib/src/structures/ITtscFountainDiagnosticsResult.d.ts +5 -0
  51. package/lib/src/structures/ITtscFountainDiagnosticsResult.js +3 -0
  52. package/lib/src/structures/ITtscFountainDiagnosticsResult.js.map +1 -0
  53. package/lib/src/structures/ITtscNodeAtPositionResult.d.ts +6 -0
  54. package/lib/src/structures/ITtscNodeAtPositionResult.js +3 -0
  55. package/lib/src/structures/ITtscNodeAtPositionResult.js.map +1 -0
  56. package/lib/src/structures/ITtscNodeInfo.d.ts +13 -0
  57. package/lib/src/structures/ITtscNodeInfo.js +3 -0
  58. package/lib/src/structures/ITtscNodeInfo.js.map +1 -0
  59. package/lib/src/structures/ITtscPluginOpts.d.ts +13 -0
  60. package/lib/src/structures/ITtscPluginOpts.js +3 -0
  61. package/lib/src/structures/ITtscPluginOpts.js.map +1 -0
  62. package/lib/src/structures/ITtscPositionQuery.d.ts +12 -0
  63. package/lib/src/structures/ITtscPositionQuery.js +3 -0
  64. package/lib/src/structures/ITtscPositionQuery.js.map +1 -0
  65. package/lib/src/structures/ITtscReleaseSnapshotResult.d.ts +5 -0
  66. package/lib/src/structures/ITtscReleaseSnapshotResult.js +3 -0
  67. package/lib/src/structures/ITtscReleaseSnapshotResult.js.map +1 -0
  68. package/lib/src/structures/ITtscResult.d.ts +15 -0
  69. package/lib/src/structures/ITtscResult.js +3 -0
  70. package/lib/src/structures/ITtscResult.js.map +1 -0
  71. package/lib/src/structures/ITtscSnapshotHandle.d.ts +5 -0
  72. package/lib/src/structures/ITtscSnapshotHandle.js +3 -0
  73. package/lib/src/structures/ITtscSnapshotHandle.js.map +1 -0
  74. package/lib/src/structures/ITtscSnapshotResult.d.ts +5 -0
  75. package/lib/src/structures/ITtscSnapshotResult.js +3 -0
  76. package/lib/src/structures/ITtscSnapshotResult.js.map +1 -0
  77. package/lib/src/structures/ITtscSnapshotsResult.d.ts +4 -0
  78. package/lib/src/structures/ITtscSnapshotsResult.js +3 -0
  79. package/lib/src/structures/ITtscSnapshotsResult.js.map +1 -0
  80. package/lib/src/structures/ITtscSourceFileTextResult.d.ts +5 -0
  81. package/lib/src/structures/ITtscSourceFileTextResult.js +3 -0
  82. package/lib/src/structures/ITtscSourceFileTextResult.js.map +1 -0
  83. package/lib/src/structures/ITtscSourceFilesResult.d.ts +5 -0
  84. package/lib/src/structures/ITtscSourceFilesResult.js +3 -0
  85. package/lib/src/structures/ITtscSourceFilesResult.js.map +1 -0
  86. package/lib/src/structures/ITtscSymbolAtPositionResult.d.ts +6 -0
  87. package/lib/src/structures/ITtscSymbolAtPositionResult.js +3 -0
  88. package/lib/src/structures/ITtscSymbolAtPositionResult.js.map +1 -0
  89. package/lib/src/structures/ITtscSymbolDeclaration.d.ts +7 -0
  90. package/lib/src/structures/ITtscSymbolDeclaration.js +3 -0
  91. package/lib/src/structures/ITtscSymbolDeclaration.js.map +1 -0
  92. package/lib/src/structures/ITtscSymbolInfo.d.ts +14 -0
  93. package/lib/src/structures/ITtscSymbolInfo.js +3 -0
  94. package/lib/src/structures/ITtscSymbolInfo.js.map +1 -0
  95. package/lib/src/structures/ITtscTransformResult.d.ts +12 -0
  96. package/lib/src/structures/ITtscTransformResult.js +3 -0
  97. package/lib/src/structures/ITtscTransformResult.js.map +1 -0
  98. package/lib/src/structures/ITtscTypeAtPositionResult.d.ts +6 -0
  99. package/lib/src/structures/ITtscTypeAtPositionResult.js +3 -0
  100. package/lib/src/structures/ITtscTypeAtPositionResult.js.map +1 -0
  101. package/lib/src/structures/ITtscTypeInfo.d.ts +7 -0
  102. package/lib/src/structures/ITtscTypeInfo.js +3 -0
  103. package/lib/src/structures/ITtscTypeInfo.js.map +1 -0
  104. package/lib/src/structures/ITtscVersion.d.ts +9 -0
  105. package/lib/src/structures/ITtscVersion.js +3 -0
  106. package/lib/src/structures/ITtscVersion.js.map +1 -0
  107. package/lib/src/{MemFS.d.ts → structures/IWasmExecFS.d.ts} +7 -66
  108. package/lib/src/structures/IWasmExecFS.js +3 -0
  109. package/lib/src/structures/IWasmExecFS.js.map +1 -0
  110. package/lib/src/structures/index.d.ts +29 -0
  111. package/lib/src/structures/index.js +46 -0
  112. package/lib/src/structures/index.js.map +1 -0
  113. package/package.json +2 -2
  114. package/shim-vendor/shim/ast/lint.go +1 -1
  115. package/shim-vendor/shim/checker/shim.go +3 -0
  116. package/shim-vendor/shim/core/shim.go +11 -0
  117. package/src/MemFSError.ts +43 -0
  118. package/src/bootTtsc.ts +212 -0
  119. package/src/{MemFS.ts → createMemFS.ts} +12 -231
  120. package/src/index.ts +5 -17
  121. package/src/parseResult.ts +16 -0
  122. package/src/structures/IBootResult.ts +10 -0
  123. package/src/structures/IBootTtscOptions.ts +21 -0
  124. package/src/structures/IFileStats.ts +23 -0
  125. package/src/structures/IMemFSHost.ts +18 -0
  126. package/src/structures/ITtscApi.ts +101 -0
  127. package/src/structures/ITtscBuildOpts.ts +7 -0
  128. package/src/structures/ITtscCompileResult.ts +12 -0
  129. package/src/structures/ITtscDiagnostic.ts +14 -0
  130. package/src/structures/ITtscFileQuery.ts +7 -0
  131. package/src/structures/ITtscFountainDiagnosticsResult.ts +6 -0
  132. package/src/structures/ITtscNodeAtPositionResult.ts +7 -0
  133. package/src/structures/ITtscNodeInfo.ts +13 -0
  134. package/src/structures/ITtscPluginOpts.ts +13 -0
  135. package/src/structures/ITtscPositionQuery.ts +13 -0
  136. package/src/structures/ITtscReleaseSnapshotResult.ts +5 -0
  137. package/src/structures/ITtscResult.ts +15 -0
  138. package/src/structures/ITtscSnapshotHandle.ts +5 -0
  139. package/src/structures/ITtscSnapshotResult.ts +5 -0
  140. package/src/structures/ITtscSnapshotsResult.ts +4 -0
  141. package/src/structures/ITtscSourceFileTextResult.ts +5 -0
  142. package/src/structures/ITtscSourceFilesResult.ts +5 -0
  143. package/src/structures/ITtscSymbolAtPositionResult.ts +7 -0
  144. package/src/structures/ITtscSymbolDeclaration.ts +7 -0
  145. package/src/structures/ITtscSymbolInfo.ts +15 -0
  146. package/src/structures/ITtscTransformResult.ts +13 -0
  147. package/src/structures/ITtscTypeAtPositionResult.ts +7 -0
  148. package/src/structures/ITtscTypeInfo.ts +7 -0
  149. package/src/structures/ITtscVersion.ts +9 -0
  150. package/src/structures/IWasmExecFS.ts +150 -0
  151. package/src/structures/index.ts +29 -0
  152. package/lib/src/MemFS.js.map +0 -1
  153. package/lib/src/api.d.ts +0 -120
  154. package/lib/src/api.js +0 -23
  155. package/lib/src/api.js.map +0 -1
  156. package/lib/src/instantiate.js +0 -88
  157. package/lib/src/instantiate.js.map +0 -1
  158. package/src/api.ts +0 -145
  159. package/src/instantiate.ts +0 -137
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ITtscFileQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITtscFileQuery.js","sourceRoot":"","sources":["../../../src/structures/ITtscFileQuery.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type { ITtscDiagnostic } from "./ITtscDiagnostic";
2
+ /** Payload inside `ITtscResult.result` for `getDiagnostics`. */
3
+ export interface ITtscFountainDiagnosticsResult {
4
+ diagnostics: ITtscDiagnostic[];
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ITtscFountainDiagnosticsResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITtscFountainDiagnosticsResult.js","sourceRoot":"","sources":["../../../src/structures/ITtscFountainDiagnosticsResult.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { ITtscNodeInfo } from "./ITtscNodeInfo";
2
+ /** Payload inside `ITtscResult.result` for `getNodeAtPosition`. */
3
+ export interface ITtscNodeAtPositionResult {
4
+ /** `null` when no node covers the position. */
5
+ node: ITtscNodeInfo | null;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ITtscNodeAtPositionResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITtscNodeAtPositionResult.js","sourceRoot":"","sources":["../../../src/structures/ITtscNodeAtPositionResult.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ /** AST node shape returned by `getNodeAtPosition`. */
2
+ export interface ITtscNodeInfo {
3
+ /** Numeric `ast.Kind` from TypeScript-Go. */
4
+ kind: number;
5
+ /** Human-readable name of `kind`. */
6
+ kindName: string;
7
+ /** Byte offset where the node begins (inclusive). */
8
+ pos: number;
9
+ /** Byte offset where the node ends (exclusive). */
10
+ end: number;
11
+ /** Source text covered by the node, when available. */
12
+ text?: string;
13
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ITtscNodeInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITtscNodeInfo.js","sourceRoot":"","sources":["../../../src/structures/ITtscNodeInfo.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ /** Options for dispatching a named plugin subcommand via `api.plugin`. */
2
+ export interface ITtscPluginOpts {
3
+ /** Plugin id registered with `host.Expose` (e.g. `@ttsc/banner`). */
4
+ name: string;
5
+ /** Subcommand the plugin's Run will receive (e.g. `build`). */
6
+ command: string;
7
+ /** Forwarded as `--cwd=<value>`. */
8
+ cwd?: string;
9
+ /** Forwarded as `--tsconfig=<value>`. Defaults to `tsconfig.json`. */
10
+ tsconfig?: string;
11
+ /** Any extra key/value pairs map to `--key=value` argv entries. */
12
+ [key: string]: string | boolean | number | undefined;
13
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ITtscPluginOpts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITtscPluginOpts.js","sourceRoot":"","sources":["../../../src/structures/ITtscPluginOpts.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import type { ITtscFileQuery } from "./ITtscFileQuery";
2
+ /**
3
+ * Request shape for `getNodeAtPosition`, `getTypeAtPosition`,
4
+ * `getSymbolAtPosition`.
5
+ */
6
+ export interface ITtscPositionQuery extends ITtscFileQuery {
7
+ /**
8
+ * Byte offset into the file's source text. JS callers with a UTF-16
9
+ * line/character pair must resolve it to a byte offset first.
10
+ */
11
+ position: number;
12
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ITtscPositionQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITtscPositionQuery.js","sourceRoot":"","sources":["../../../src/structures/ITtscPositionQuery.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ /** Payload inside `ITtscResult.result` for `releaseSnapshot`. */
2
+ export interface ITtscReleaseSnapshotResult {
3
+ /** `false` when the handle was not present (already released). */
4
+ released: boolean;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ITtscReleaseSnapshotResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITtscReleaseSnapshotResult.js","sourceRoot":"","sources":["../../../src/structures/ITtscReleaseSnapshotResult.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ /** Envelope returned by every `ITtscApi` method. */
2
+ export interface ITtscResult {
3
+ /** Exit code. 0 = success, 2 = compiler/config/usage error, 3 = runtime error. */
4
+ code: number;
5
+ /** Anything the wasm wrote to its stdout stream. */
6
+ stdout: string;
7
+ /** Anything the wasm wrote to its stderr stream. */
8
+ stderr: string;
9
+ /**
10
+ * For the base endpoints, the JSON-encoded compile/transform result. For the
11
+ * plugin endpoint, this is empty — the plugin's own output sits in
12
+ * stdout/stderr. Use `parseResult<T>` to deserialize.
13
+ */
14
+ result: string;
15
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ITtscResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITtscResult.js","sourceRoot":"","sources":["../../../src/structures/ITtscResult.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ /** Common request shape for fountain verbs that act on an existing snapshot. */
2
+ export interface ITtscSnapshotHandle {
3
+ /** Opaque handle returned by `snapshot`. */
4
+ handle: string;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ITtscSnapshotHandle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITtscSnapshotHandle.js","sourceRoot":"","sources":["../../../src/structures/ITtscSnapshotHandle.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ /** Payload inside `ITtscResult.result` for `snapshot`. */
2
+ export interface ITtscSnapshotResult {
3
+ /** Opaque handle; pass back to fountain verbs and to `releaseSnapshot`. */
4
+ handle: string;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ITtscSnapshotResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITtscSnapshotResult.js","sourceRoot":"","sources":["../../../src/structures/ITtscSnapshotResult.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ /** Payload inside `ITtscResult.result` for `snapshots`. */
2
+ export interface ITtscSnapshotsResult {
3
+ handles: string[];
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ITtscSnapshotsResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITtscSnapshotsResult.js","sourceRoot":"","sources":["../../../src/structures/ITtscSnapshotsResult.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ /** Payload inside `ITtscResult.result` for `getSourceFileText`. */
2
+ export interface ITtscSourceFileTextResult {
3
+ /** Current source text held by the snapshot's program. */
4
+ text: string;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ITtscSourceFileTextResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITtscSourceFileTextResult.js","sourceRoot":"","sources":["../../../src/structures/ITtscSourceFileTextResult.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ /** Payload inside `ITtscResult.result` for `getSourceFiles`. */
2
+ export interface ITtscSourceFilesResult {
3
+ /** Project-relative paths of non-declaration source files. */
4
+ files: string[];
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ITtscSourceFilesResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITtscSourceFilesResult.js","sourceRoot":"","sources":["../../../src/structures/ITtscSourceFilesResult.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { ITtscSymbolInfo } from "./ITtscSymbolInfo";
2
+ /** Payload inside `ITtscResult.result` for `getSymbolAtPosition`. */
3
+ export interface ITtscSymbolAtPositionResult {
4
+ /** `null` when the node has no associated symbol. */
5
+ symbol: ITtscSymbolInfo | null;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ITtscSymbolAtPositionResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITtscSymbolAtPositionResult.js","sourceRoot":"","sources":["../../../src/structures/ITtscSymbolAtPositionResult.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ /** A single declaration site for a symbol. */
2
+ export interface ITtscSymbolDeclaration {
3
+ /** Project-relative or absolute path; `null` for synthetic declarations. */
4
+ file: string | null;
5
+ pos: number;
6
+ end: number;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ITtscSymbolDeclaration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITtscSymbolDeclaration.js","sourceRoot":"","sources":["../../../src/structures/ITtscSymbolDeclaration.ts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ import type { ITtscSymbolDeclaration } from "./ITtscSymbolDeclaration";
2
+ /** Symbol shape returned by `getSymbolAtPosition`. */
3
+ export interface ITtscSymbolInfo {
4
+ /** Raw symbol name, including TypeScript's internal prefix markers. */
5
+ name: string;
6
+ /** Printed symbol, equivalent to TypeScript's `SymbolToString(s)`. */
7
+ text?: string;
8
+ /** Numeric `SymbolFlags` bitmask from TypeScript-Go. */
9
+ flags: number;
10
+ /** Up to 16 declaration sites; see `declarationCount` for the unclamped total. */
11
+ declarations?: ITtscSymbolDeclaration[];
12
+ /** Total number of declarations, even when `declarations` was clamped. */
13
+ declarationCount?: number;
14
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ITtscSymbolInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITtscSymbolInfo.js","sourceRoot":"","sources":["../../../src/structures/ITtscSymbolInfo.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import type { ITtscDiagnostic } from "./ITtscDiagnostic";
2
+ /**
3
+ * Structured payload inside `ITtscResult.result` for `transform`.
4
+ *
5
+ * `typescript` maps source file paths (relative to `cwd`) to their
6
+ * post-transform TypeScript text — useful for playgrounds that want to show the
7
+ * rewritten source before it is emitted.
8
+ */
9
+ export interface ITtscTransformResult {
10
+ diagnostics?: ITtscDiagnostic[];
11
+ typescript: Record<string, string>;
12
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ITtscTransformResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITtscTransformResult.js","sourceRoot":"","sources":["../../../src/structures/ITtscTransformResult.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { ITtscTypeInfo } from "./ITtscTypeInfo";
2
+ /** Payload inside `ITtscResult.result` for `getTypeAtPosition`. */
3
+ export interface ITtscTypeAtPositionResult {
4
+ /** `null` when the node has no associated type. */
5
+ type: ITtscTypeInfo | null;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ITtscTypeAtPositionResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITtscTypeAtPositionResult.js","sourceRoot":"","sources":["../../../src/structures/ITtscTypeAtPositionResult.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ /** Type shape returned by `getTypeAtPosition`. */
2
+ export interface ITtscTypeInfo {
3
+ /** Printed type, equivalent to TypeScript's `TypeToString(t)`. */
4
+ text: string;
5
+ /** Numeric `TypeFlags` bitmask from TypeScript-Go. */
6
+ flags: number;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ITtscTypeInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITtscTypeInfo.js","sourceRoot":"","sources":["../../../src/structures/ITtscTypeInfo.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ /** Build metadata embedded in the wasm by the Go linker at compile time. */
2
+ export interface ITtscVersion {
3
+ version: string;
4
+ commit: string;
5
+ date: string;
6
+ go: string;
7
+ goos: string;
8
+ goarch: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ITtscVersion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ITtscVersion.js","sourceRoot":"","sources":["../../../src/structures/ITtscVersion.ts"],"names":[],"mappings":""}
@@ -1,3 +1,4 @@
1
+ import type { IFileStats } from "./IFileStats";
1
2
  /**
2
3
  * Subset of the Node.js `fs` module that `wasm_exec.js` calls into.
3
4
  *
@@ -34,71 +35,11 @@ export interface IWasmExecFS {
34
35
  readlink(path: string, callback: (err: NodeJS.ErrnoException | null, link: string) => void): void;
35
36
  truncate(path: string, length: number, callback: (err: NodeJS.ErrnoException | null) => void): void;
36
37
  ftruncate(fd: number, length: number, callback: (err: NodeJS.ErrnoException | null) => void): void;
38
+ /**
39
+ * `pipe2` is what Go's wasm `os.Pipe()` calls. Returns two fds: a read end
40
+ * and a write end. The host's stdout/stderr capture currently uses MemFS temp
41
+ * files, but this keeps direct pipe callers compatible with the wasm fs
42
+ * surface.
43
+ */
37
44
  pipe2(flags: number, callback: (err: NodeJS.ErrnoException | null, fds: [number, number]) => void): void;
38
45
  }
39
- /**
40
- * Stat-like object returned by `stat`, `lstat`, and `fstat`.
41
- *
42
- * Mirrors the subset of `fs.Stats` that `wasm_exec.js` reads. Fields not
43
- * relevant to Go's `os.FileInfo` (e.g. ownership) are zeroed.
44
- */
45
- export interface IFileStats {
46
- isDirectory(): boolean;
47
- isFile(): boolean;
48
- size: number;
49
- mode: number;
50
- mtimeMs: number;
51
- atimeMs: number;
52
- ctimeMs: number;
53
- dev: number;
54
- ino: number;
55
- nlink: number;
56
- uid: number;
57
- gid: number;
58
- rdev: number;
59
- blksize: number;
60
- blocks: number;
61
- }
62
- /**
63
- * Filesystem error with a POSIX error code and numeric `errno`.
64
- *
65
- * Matches the shape of `NodeJS.ErrnoException` so Go's os package interprets it
66
- * as a proper `os.PathError` with a numeric error code.
67
- */
68
- export declare class MemFSError extends Error {
69
- code: string;
70
- errno: number;
71
- path?: string;
72
- syscall?: string;
73
- constructor(code: string, syscall: string, path?: string);
74
- }
75
- /**
76
- * Handle returned by `createMemFS`. Provides the `fs` shim to install on
77
- * `globalThis` plus convenience methods for seeding the virtual filesystem
78
- * before booting the wasm.
79
- */
80
- export interface IMemFSHost {
81
- fs: IWasmExecFS;
82
- writeFile(path: string, data: string | Uint8Array): void;
83
- readFile(path: string): Uint8Array | null;
84
- readFileText(path: string): string | null;
85
- exists(path: string): boolean;
86
- mkdirp(path: string): void;
87
- stdout: {
88
- buffer: string;
89
- };
90
- stderr: {
91
- buffer: string;
92
- };
93
- resetStdio(): void;
94
- }
95
- /**
96
- * Create an in-memory filesystem suitable for use as `globalThis.fs` inside a
97
- * Go/wasm runtime.
98
- *
99
- * The returned host exposes the low-level `fs` object (install it on
100
- * `globalThis.fs` before loading `wasm_exec.js`) and convenience helpers
101
- * (`writeFile`, `readFile`, `mkdirp`, …) for seeding source files and reading
102
- * compiler output without touching the real filesystem.
103
- */
104
- export declare function createMemFS(): IMemFSHost;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IWasmExecFS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IWasmExecFS.js","sourceRoot":"","sources":["../../../src/structures/IWasmExecFS.ts"],"names":[],"mappings":""}
@@ -0,0 +1,29 @@
1
+ export * from "./IBootResult";
2
+ export * from "./IBootTtscOptions";
3
+ export * from "./IFileStats";
4
+ export * from "./IMemFSHost";
5
+ export * from "./ITtscApi";
6
+ export * from "./ITtscBuildOpts";
7
+ export * from "./ITtscCompileResult";
8
+ export * from "./ITtscDiagnostic";
9
+ export * from "./ITtscFileQuery";
10
+ export * from "./ITtscFountainDiagnosticsResult";
11
+ export * from "./ITtscNodeAtPositionResult";
12
+ export * from "./ITtscNodeInfo";
13
+ export * from "./ITtscPluginOpts";
14
+ export * from "./ITtscPositionQuery";
15
+ export * from "./ITtscReleaseSnapshotResult";
16
+ export * from "./ITtscResult";
17
+ export * from "./ITtscSnapshotHandle";
18
+ export * from "./ITtscSnapshotResult";
19
+ export * from "./ITtscSnapshotsResult";
20
+ export * from "./ITtscSourceFileTextResult";
21
+ export * from "./ITtscSourceFilesResult";
22
+ export * from "./ITtscSymbolAtPositionResult";
23
+ export * from "./ITtscSymbolDeclaration";
24
+ export * from "./ITtscSymbolInfo";
25
+ export * from "./ITtscTransformResult";
26
+ export * from "./ITtscTypeAtPositionResult";
27
+ export * from "./ITtscTypeInfo";
28
+ export * from "./ITtscVersion";
29
+ export * from "./IWasmExecFS";
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./IBootResult"), exports);
18
+ __exportStar(require("./IBootTtscOptions"), exports);
19
+ __exportStar(require("./IFileStats"), exports);
20
+ __exportStar(require("./IMemFSHost"), exports);
21
+ __exportStar(require("./ITtscApi"), exports);
22
+ __exportStar(require("./ITtscBuildOpts"), exports);
23
+ __exportStar(require("./ITtscCompileResult"), exports);
24
+ __exportStar(require("./ITtscDiagnostic"), exports);
25
+ __exportStar(require("./ITtscFileQuery"), exports);
26
+ __exportStar(require("./ITtscFountainDiagnosticsResult"), exports);
27
+ __exportStar(require("./ITtscNodeAtPositionResult"), exports);
28
+ __exportStar(require("./ITtscNodeInfo"), exports);
29
+ __exportStar(require("./ITtscPluginOpts"), exports);
30
+ __exportStar(require("./ITtscPositionQuery"), exports);
31
+ __exportStar(require("./ITtscReleaseSnapshotResult"), exports);
32
+ __exportStar(require("./ITtscResult"), exports);
33
+ __exportStar(require("./ITtscSnapshotHandle"), exports);
34
+ __exportStar(require("./ITtscSnapshotResult"), exports);
35
+ __exportStar(require("./ITtscSnapshotsResult"), exports);
36
+ __exportStar(require("./ITtscSourceFileTextResult"), exports);
37
+ __exportStar(require("./ITtscSourceFilesResult"), exports);
38
+ __exportStar(require("./ITtscSymbolAtPositionResult"), exports);
39
+ __exportStar(require("./ITtscSymbolDeclaration"), exports);
40
+ __exportStar(require("./ITtscSymbolInfo"), exports);
41
+ __exportStar(require("./ITtscTransformResult"), exports);
42
+ __exportStar(require("./ITtscTypeAtPositionResult"), exports);
43
+ __exportStar(require("./ITtscTypeInfo"), exports);
44
+ __exportStar(require("./ITtscVersion"), exports);
45
+ __exportStar(require("./IWasmExecFS"), exports);
46
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/structures/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,qDAAmC;AACnC,+CAA6B;AAC7B,+CAA6B;AAC7B,6CAA2B;AAC3B,mDAAiC;AACjC,uDAAqC;AACrC,oDAAkC;AAClC,mDAAiC;AACjC,mEAAiD;AACjD,8DAA4C;AAC5C,kDAAgC;AAChC,oDAAkC;AAClC,uDAAqC;AACrC,+DAA6C;AAC7C,gDAA8B;AAC9B,wDAAsC;AACtC,wDAAsC;AACtC,yDAAuC;AACvC,8DAA4C;AAC5C,2DAAyC;AACzC,gEAA8C;AAC9C,2DAAyC;AACzC,oDAAkC;AAClC,yDAAuC;AACvC,8DAA4C;AAC5C,kDAAgC;AAChC,iDAA+B;AAC/B,gDAA8B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttsc/wasm",
3
- "version": "0.13.1",
3
+ "version": "0.14.0-dev.20250530.1",
4
4
  "description": "Build in-browser ttsc playgrounds. Compose ttsc + typescript-go with your own plugins via the Go host helper.",
5
5
  "main": "lib/src/index.js",
6
6
  "types": "lib/src/index.d.ts",
@@ -38,7 +38,7 @@
38
38
  "homepage": "https://ttsc.dev",
39
39
  "devDependencies": {
40
40
  "@types/node": "^25.3.0",
41
- "@typescript/native-preview": "7.0.0-dev.20260522.1",
41
+ "@typescript/native-preview": "7.0.0-dev.20260527.2",
42
42
  "rimraf": "^6.1.2"
43
43
  },
44
44
  "scripts": {
@@ -111,7 +111,7 @@ type YieldExpression = innerast.YieldExpression
111
111
  type RegularExpressionLiteral = innerast.RegularExpressionLiteral
112
112
  type SatisfiesExpression = innerast.SatisfiesExpression
113
113
 
114
- // ---- Comment directives (ban-ts-comment) ----
114
+ // ---- Comment directives (banTsComment) ----
115
115
 
116
116
  type CommentDirective = innerast.CommentDirective
117
117
  type CommentDirectiveKind = innerast.CommentDirectiveKind
@@ -46,6 +46,9 @@ const (
46
46
  TypeFlagsNumberLike = innerchecker.TypeFlagsNumberLike
47
47
  TypeFlagsBigIntLike = innerchecker.TypeFlagsBigIntLike
48
48
  TypeFlagsBooleanLike = innerchecker.TypeFlagsBooleanLike
49
+ TypeFlagsEnum = innerchecker.TypeFlagsEnum
50
+ TypeFlagsEnumLiteral = innerchecker.TypeFlagsEnumLiteral
51
+ TypeFlagsEnumLike = innerchecker.TypeFlagsEnumLike
49
52
 
50
53
  ObjectFlagsReference = innerchecker.ObjectFlagsReference
51
54
  ObjectFlagsClass = innerchecker.ObjectFlagsClass
@@ -10,6 +10,9 @@ import innercore "github.com/microsoft/typescript-go/internal/core"
10
10
  // TypeScript-Go program host.
11
11
  type CompilerOptions = innercore.CompilerOptions
12
12
 
13
+ // JsxEmit is the parsed compilerOptions.jsx mode.
14
+ type JsxEmit = innercore.JsxEmit
15
+
13
16
  // Tristate is a three-valued boolean: TSFalse, TSTrue, or TSUnknown. Used by
14
17
  // CompilerOptions fields that can be explicitly unset.
15
18
  type Tristate = innercore.Tristate
@@ -37,6 +40,14 @@ const (
37
40
  ScriptKindExternal = innercore.ScriptKindExternal
38
41
  ScriptKindJSON = innercore.ScriptKindJSON
39
42
  ScriptKindDeferred = innercore.ScriptKindDeferred
43
+
44
+ // JsxEmit* constants enumerate compilerOptions.jsx modes.
45
+ JsxEmitNone = innercore.JsxEmitNone
46
+ JsxEmitPreserve = innercore.JsxEmitPreserve
47
+ JsxEmitReactNative = innercore.JsxEmitReactNative
48
+ JsxEmitReact = innercore.JsxEmitReact
49
+ JsxEmitReactJSX = innercore.JsxEmitReactJSX
50
+ JsxEmitReactJSXDev = innercore.JsxEmitReactJSXDev
40
51
  )
41
52
 
42
53
  // NewTextRange constructs a closed/open [pos, end) text range.