@justscale/typescript 0.1.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.
- package/LICENSE +21 -0
- package/README.md +128 -0
- package/dist/api.d.ts +144 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +380 -0
- package/dist/api.js.map +1 -0
- package/dist/compiler/analyzer.d.ts +247 -0
- package/dist/compiler/analyzer.d.ts.map +1 -0
- package/dist/compiler/analyzer.js +3201 -0
- package/dist/compiler/analyzer.js.map +1 -0
- package/dist/compiler/cli.d.ts +12 -0
- package/dist/compiler/cli.d.ts.map +1 -0
- package/dist/compiler/cli.js +209 -0
- package/dist/compiler/cli.js.map +1 -0
- package/dist/compiler/compile.d.ts +26 -0
- package/dist/compiler/compile.d.ts.map +1 -0
- package/dist/compiler/compile.js +121 -0
- package/dist/compiler/compile.js.map +1 -0
- package/dist/compiler/errors.d.ts +336 -0
- package/dist/compiler/errors.d.ts.map +1 -0
- package/dist/compiler/errors.js +466 -0
- package/dist/compiler/errors.js.map +1 -0
- package/dist/compiler/exports-prepass.d.ts +31 -0
- package/dist/compiler/exports-prepass.d.ts.map +1 -0
- package/dist/compiler/exports-prepass.js +249 -0
- package/dist/compiler/exports-prepass.js.map +1 -0
- package/dist/compiler/hmr-change-detector.d.ts +47 -0
- package/dist/compiler/hmr-change-detector.d.ts.map +1 -0
- package/dist/compiler/hmr-change-detector.js +395 -0
- package/dist/compiler/hmr-change-detector.js.map +1 -0
- package/dist/compiler/hmr-transformer.d.ts +54 -0
- package/dist/compiler/hmr-transformer.d.ts.map +1 -0
- package/dist/compiler/hmr-transformer.js +535 -0
- package/dist/compiler/hmr-transformer.js.map +1 -0
- package/dist/compiler/index.d.ts +19 -0
- package/dist/compiler/index.d.ts.map +1 -0
- package/dist/compiler/index.js +16 -0
- package/dist/compiler/index.js.map +1 -0
- package/dist/compiler/primitive-detector.d.ts +70 -0
- package/dist/compiler/primitive-detector.d.ts.map +1 -0
- package/dist/compiler/primitive-detector.js +338 -0
- package/dist/compiler/primitive-detector.js.map +1 -0
- package/dist/compiler/ptsc.d.ts +40 -0
- package/dist/compiler/ptsc.d.ts.map +1 -0
- package/dist/compiler/ptsc.js +462 -0
- package/dist/compiler/ptsc.js.map +1 -0
- package/dist/compiler/rewriter.d.ts +96 -0
- package/dist/compiler/rewriter.d.ts.map +1 -0
- package/dist/compiler/rewriter.js +418 -0
- package/dist/compiler/rewriter.js.map +1 -0
- package/dist/compiler/step-hash.d.ts +43 -0
- package/dist/compiler/step-hash.d.ts.map +1 -0
- package/dist/compiler/step-hash.js +83 -0
- package/dist/compiler/step-hash.js.map +1 -0
- package/dist/compiler/switch-codegen.d.ts +84 -0
- package/dist/compiler/switch-codegen.d.ts.map +1 -0
- package/dist/compiler/switch-codegen.js +1540 -0
- package/dist/compiler/switch-codegen.js.map +1 -0
- package/dist/compiler/transformer.d.ts +29 -0
- package/dist/compiler/transformer.d.ts.map +1 -0
- package/dist/compiler/transformer.js +216 -0
- package/dist/compiler/transformer.js.map +1 -0
- package/dist/config/index.d.ts +122 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +215 -0
- package/dist/config/index.js.map +1 -0
- package/dist/di-errors/formatter.d.ts +126 -0
- package/dist/di-errors/formatter.d.ts.map +1 -0
- package/dist/di-errors/formatter.js +384 -0
- package/dist/di-errors/formatter.js.map +1 -0
- package/dist/di-errors/index.d.ts +5 -0
- package/dist/di-errors/index.d.ts.map +1 -0
- package/dist/di-errors/index.js +13 -0
- package/dist/di-errors/index.js.map +1 -0
- package/dist/editor.d.ts +11 -0
- package/dist/editor.d.ts.map +1 -0
- package/dist/editor.js +2 -0
- package/dist/editor.js.map +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/dist/language-service/index.d.ts +52 -0
- package/dist/language-service/index.d.ts.map +1 -0
- package/dist/language-service/index.js +366 -0
- package/dist/language-service/index.js.map +1 -0
- package/dist/language-service/process-quick-fixes.d.ts +20 -0
- package/dist/language-service/process-quick-fixes.d.ts.map +1 -0
- package/dist/language-service/process-quick-fixes.js +114 -0
- package/dist/language-service/process-quick-fixes.js.map +1 -0
- package/dist/language-service/quick-fix-discovery.d.ts +39 -0
- package/dist/language-service/quick-fix-discovery.d.ts.map +1 -0
- package/dist/language-service/quick-fix-discovery.js +124 -0
- package/dist/language-service/quick-fix-discovery.js.map +1 -0
- package/dist/loader/incremental.d.ts +50 -0
- package/dist/loader/incremental.d.ts.map +1 -0
- package/dist/loader/incremental.js +151 -0
- package/dist/loader/incremental.js.map +1 -0
- package/dist/loader/index.d.ts +25 -0
- package/dist/loader/index.d.ts.map +1 -0
- package/dist/loader/index.js +24 -0
- package/dist/loader/index.js.map +1 -0
- package/dist/loader/loader.d.ts +52 -0
- package/dist/loader/loader.d.ts.map +1 -0
- package/dist/loader/loader.js +248 -0
- package/dist/loader/loader.js.map +1 -0
- package/dist/loader/register.d.ts +14 -0
- package/dist/loader/register.d.ts.map +1 -0
- package/dist/loader/register.js +20 -0
- package/dist/loader/register.js.map +1 -0
- package/dist/plugins/index.d.ts +13 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +13 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/index.public.d.ts +13 -0
- package/dist/plugins/index.public.d.ts.map +1 -0
- package/dist/plugins/index.public.js +13 -0
- package/dist/plugins/index.public.js.map +1 -0
- package/dist/plugins/types.d.ts +83 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +24 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/server/index.d.ts +33 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +42 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/tsserver.d.ts +28 -0
- package/dist/server/tsserver.d.ts.map +1 -0
- package/dist/server/tsserver.js +126 -0
- package/dist/server/tsserver.js.map +1 -0
- package/lib/lib.d.ts +20 -0
- package/lib/lib.decorators.d.ts +382 -0
- package/lib/lib.decorators.legacy.d.ts +20 -0
- package/lib/lib.dom.asynciterable.d.ts +18 -0
- package/lib/lib.dom.d.ts +45125 -0
- package/lib/lib.dom.iterable.d.ts +18 -0
- package/lib/lib.es2015.collection.d.ts +150 -0
- package/lib/lib.es2015.core.d.ts +595 -0
- package/lib/lib.es2015.d.ts +26 -0
- package/lib/lib.es2015.generator.d.ts +75 -0
- package/lib/lib.es2015.iterable.d.ts +603 -0
- package/lib/lib.es2015.promise.d.ts +79 -0
- package/lib/lib.es2015.proxy.d.ts +126 -0
- package/lib/lib.es2015.reflect.d.ts +142 -0
- package/lib/lib.es2015.symbol.d.ts +44 -0
- package/lib/lib.es2015.symbol.wellknown.d.ts +324 -0
- package/lib/lib.es2016.array.include.d.ts +114 -0
- package/lib/lib.es2016.d.ts +19 -0
- package/lib/lib.es2016.full.d.ts +21 -0
- package/lib/lib.es2016.intl.d.ts +29 -0
- package/lib/lib.es2017.arraybuffer.d.ts +19 -0
- package/lib/lib.es2017.d.ts +24 -0
- package/lib/lib.es2017.date.d.ts +29 -0
- package/lib/lib.es2017.full.d.ts +21 -0
- package/lib/lib.es2017.intl.d.ts +42 -0
- package/lib/lib.es2017.object.d.ts +47 -0
- package/lib/lib.es2017.sharedmemory.d.ts +133 -0
- package/lib/lib.es2017.string.d.ts +43 -0
- package/lib/lib.es2017.typedarrays.d.ts +51 -0
- package/lib/lib.es2018.asyncgenerator.d.ts +75 -0
- package/lib/lib.es2018.asynciterable.d.ts +51 -0
- package/lib/lib.es2018.d.ts +22 -0
- package/lib/lib.es2018.full.d.ts +22 -0
- package/lib/lib.es2018.intl.d.ts +81 -0
- package/lib/lib.es2018.promise.d.ts +28 -0
- package/lib/lib.es2018.regexp.d.ts +35 -0
- package/lib/lib.es2019.array.d.ts +77 -0
- package/lib/lib.es2019.d.ts +22 -0
- package/lib/lib.es2019.full.d.ts +22 -0
- package/lib/lib.es2019.intl.d.ts +21 -0
- package/lib/lib.es2019.object.d.ts +31 -0
- package/lib/lib.es2019.string.d.ts +35 -0
- package/lib/lib.es2019.symbol.d.ts +22 -0
- package/lib/lib.es2020.bigint.d.ts +763 -0
- package/lib/lib.es2020.d.ts +25 -0
- package/lib/lib.es2020.date.d.ts +40 -0
- package/lib/lib.es2020.full.d.ts +22 -0
- package/lib/lib.es2020.intl.d.ts +472 -0
- package/lib/lib.es2020.number.d.ts +26 -0
- package/lib/lib.es2020.promise.d.ts +45 -0
- package/lib/lib.es2020.sharedmemory.d.ts +97 -0
- package/lib/lib.es2020.string.d.ts +42 -0
- package/lib/lib.es2020.symbol.wellknown.d.ts +39 -0
- package/lib/lib.es2021.d.ts +21 -0
- package/lib/lib.es2021.full.d.ts +22 -0
- package/lib/lib.es2021.intl.d.ts +164 -0
- package/lib/lib.es2021.promise.d.ts +46 -0
- package/lib/lib.es2021.string.d.ts +31 -0
- package/lib/lib.es2021.weakref.d.ts +76 -0
- package/lib/lib.es2022.array.d.ts +119 -0
- package/lib/lib.es2022.d.ts +23 -0
- package/lib/lib.es2022.error.d.ts +73 -0
- package/lib/lib.es2022.full.d.ts +22 -0
- package/lib/lib.es2022.intl.d.ts +143 -0
- package/lib/lib.es2022.object.d.ts +24 -0
- package/lib/lib.es2022.regexp.d.ts +37 -0
- package/lib/lib.es2022.string.d.ts +23 -0
- package/lib/lib.es2023.array.d.ts +922 -0
- package/lib/lib.es2023.collection.d.ts +19 -0
- package/lib/lib.es2023.d.ts +20 -0
- package/lib/lib.es2023.full.d.ts +22 -0
- package/lib/lib.es2023.intl.d.ts +62 -0
- package/lib/lib.es2024.arraybuffer.d.ts +63 -0
- package/lib/lib.es2024.collection.d.ts +27 -0
- package/lib/lib.es2024.d.ts +24 -0
- package/lib/lib.es2024.full.d.ts +22 -0
- package/lib/lib.es2024.object.d.ts +27 -0
- package/lib/lib.es2024.promise.d.ts +33 -0
- package/lib/lib.es2024.regexp.d.ts +23 -0
- package/lib/lib.es2024.sharedmemory.d.ts +66 -0
- package/lib/lib.es2024.string.d.ts +27 -0
- package/lib/lib.es2025.collection.d.ts +94 -0
- package/lib/lib.es2025.d.ts +23 -0
- package/lib/lib.es2025.float16.d.ts +443 -0
- package/lib/lib.es2025.full.d.ts +22 -0
- package/lib/lib.es2025.intl.d.ts +200 -0
- package/lib/lib.es2025.iterator.d.ts +146 -0
- package/lib/lib.es2025.promise.d.ts +32 -0
- package/lib/lib.es2025.regexp.d.ts +30 -0
- package/lib/lib.es5.d.ts +4599 -0
- package/lib/lib.es6.d.ts +21 -0
- package/lib/lib.esnext.array.d.ts +33 -0
- package/lib/lib.esnext.collection.d.ts +47 -0
- package/lib/lib.esnext.d.ts +27 -0
- package/lib/lib.esnext.date.d.ts +21 -0
- package/lib/lib.esnext.decorators.d.ts +26 -0
- package/lib/lib.esnext.disposable.d.ts +191 -0
- package/lib/lib.esnext.error.d.ts +22 -0
- package/lib/lib.esnext.full.d.ts +22 -0
- package/lib/lib.esnext.intl.d.ts +107 -0
- package/lib/lib.esnext.sharedmemory.d.ts +23 -0
- package/lib/lib.esnext.temporal.d.ts +485 -0
- package/lib/lib.esnext.typedarrays.d.ts +90 -0
- package/lib/lib.scripthost.d.ts +320 -0
- package/lib/lib.webworker.asynciterable.d.ts +18 -0
- package/lib/lib.webworker.d.ts +15606 -0
- package/lib/lib.webworker.importscripts.d.ts +21 -0
- package/lib/lib.webworker.iterable.d.ts +18 -0
- package/lib/logger.js +144 -0
- package/lib/package.json +7 -0
- package/lib/tsserver.js +57 -0
- package/lib/tsserverlibrary.js +171 -0
- package/lib/typesMap.json +497 -0
- package/lib/typescript.js +373 -0
- package/package.json +115 -0
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom error codes for the process compiler (TSPxxxx range).
|
|
3
|
+
*/
|
|
4
|
+
import ts from 'typescript';
|
|
5
|
+
/**
|
|
6
|
+
* Custom error codes for process compilation.
|
|
7
|
+
* Range: TSP1000-TSP9999
|
|
8
|
+
*/
|
|
9
|
+
export declare const ProcessErrorCode: {
|
|
10
|
+
/**
|
|
11
|
+
* TSP1001: Non-serializable await result must use `using` declaration.
|
|
12
|
+
*
|
|
13
|
+
* Process state is serialized to storage when suspended. Awaited values
|
|
14
|
+
* from service calls (like `orders.get(Order.ref(id))`) return non-serializable
|
|
15
|
+
* objects that must be rehydrated on resume.
|
|
16
|
+
*
|
|
17
|
+
* Wrong: `const order = await orders.get(Order.ref(id))`
|
|
18
|
+
* Right: `using order = await orders.get(Order.ref(id))`
|
|
19
|
+
*/
|
|
20
|
+
readonly NonSerializableConst: 1001;
|
|
21
|
+
/**
|
|
22
|
+
* TSP1002: Signal must be awaited inside process handler.
|
|
23
|
+
*
|
|
24
|
+
* The `signal()` primitive creates a suspension point and must be awaited.
|
|
25
|
+
*
|
|
26
|
+
* Wrong: `signal(orders.complete)`
|
|
27
|
+
* Right: `await signal(orders.complete)`
|
|
28
|
+
*/
|
|
29
|
+
readonly SignalNotAwaited: 1002;
|
|
30
|
+
/**
|
|
31
|
+
* TSP1003: Invalid race pattern - switch must use `await race()`.
|
|
32
|
+
*
|
|
33
|
+
* The race pattern requires a specific structure with switch/case.
|
|
34
|
+
*/
|
|
35
|
+
readonly InvalidRacePattern: 1003;
|
|
36
|
+
/**
|
|
37
|
+
* TSP1004: Process handler must be an async function.
|
|
38
|
+
*/
|
|
39
|
+
readonly HandlerNotAsync: 1004;
|
|
40
|
+
/**
|
|
41
|
+
* TSP1005: Cannot use non-deterministic operations in process handler.
|
|
42
|
+
*
|
|
43
|
+
* Operations like `Date.now()`, `Math.random()`, or `crypto.randomUUID()`
|
|
44
|
+
* produce different results on replay and break determinism.
|
|
45
|
+
*/
|
|
46
|
+
readonly NonDeterministicOperation: 1005;
|
|
47
|
+
/**
|
|
48
|
+
* TSP1006: Signal/delay must be used directly, not stored in a variable.
|
|
49
|
+
*
|
|
50
|
+
* The compiler transforms signal() and delay() calls at compile time.
|
|
51
|
+
* Storing them in variables breaks this transformation.
|
|
52
|
+
*
|
|
53
|
+
* Wrong: `const s = signal(orders.paid); await s;`
|
|
54
|
+
* Right: `await signal(orders.paid)`
|
|
55
|
+
*
|
|
56
|
+
* Wrong: `const d = delay.minutes(5); await d;`
|
|
57
|
+
* Right: `await delay.minutes(5)`
|
|
58
|
+
*/
|
|
59
|
+
readonly SignalStoredInVariable: 1006;
|
|
60
|
+
/**
|
|
61
|
+
* TSP1007: Cannot use try-catch around suspension points.
|
|
62
|
+
*
|
|
63
|
+
* Process suspensions serialize state to storage. Exceptions cannot be
|
|
64
|
+
* caught across suspension boundaries because the try-catch context is
|
|
65
|
+
* lost when the process resumes from storage.
|
|
66
|
+
*
|
|
67
|
+
* Wrong: `try { await signal(orders.paid) } catch (e) { ... }`
|
|
68
|
+
* Right: Use race() with a timeout or handle errors in the signaling service.
|
|
69
|
+
*/
|
|
70
|
+
readonly TryCatchWithSuspension: 1007;
|
|
71
|
+
/**
|
|
72
|
+
* TSP1008: Cannot use nested async functions with suspension points.
|
|
73
|
+
*
|
|
74
|
+
* Suspension points must be directly in the process handler, not in
|
|
75
|
+
* nested async functions or callbacks. The compiler cannot track
|
|
76
|
+
* suspensions through nested function boundaries.
|
|
77
|
+
*
|
|
78
|
+
* Wrong: `const fn = async () => { await signal(...) }; await fn()`
|
|
79
|
+
* Right: Use await signal() directly in the handler.
|
|
80
|
+
*/
|
|
81
|
+
readonly NestedAsyncWithSuspension: 1008;
|
|
82
|
+
/**
|
|
83
|
+
* TSP1009: Cannot use Promise.all/Promise.race with signals.
|
|
84
|
+
*
|
|
85
|
+
* Process primitives like signal() and delay() must be awaited directly
|
|
86
|
+
* or used in a race() switch pattern. Promise combinators bypass the
|
|
87
|
+
* compiler's suspension tracking.
|
|
88
|
+
*
|
|
89
|
+
* Wrong: `await Promise.all([signal(a), signal(b)])`
|
|
90
|
+
* Right: Use sequential awaits or the race() switch pattern.
|
|
91
|
+
*/
|
|
92
|
+
readonly PromiseCombinatorWithSignal: 1009;
|
|
93
|
+
/**
|
|
94
|
+
* TSP1010: For-in loops with suspension points are not supported.
|
|
95
|
+
*
|
|
96
|
+
* For-in iteration over object keys cannot be made durable because
|
|
97
|
+
* property enumeration order is not guaranteed to be stable.
|
|
98
|
+
* Convert to Object.keys() with a for-of loop or while loop.
|
|
99
|
+
*
|
|
100
|
+
* Wrong: `for (const key in obj) { await signal(...) }`
|
|
101
|
+
* Right: `for (const key of Object.keys(obj)) { await signal(...) }`
|
|
102
|
+
*/
|
|
103
|
+
readonly ForInWithSuspension: 1010;
|
|
104
|
+
/**
|
|
105
|
+
* TSP1011: Inner function escapes handler scope.
|
|
106
|
+
*
|
|
107
|
+
* Inner functions with suspension points must be called directly within
|
|
108
|
+
* the handler. Returning them, storing them in arrays, or passing them
|
|
109
|
+
* to other functions prevents the compiler from inlining.
|
|
110
|
+
*
|
|
111
|
+
* Wrong: `const fn = async () => { await signal(...) }; return fn`
|
|
112
|
+
* Right: `const fn = async () => { await signal(...) }; await fn()`
|
|
113
|
+
*/
|
|
114
|
+
readonly FunctionEscapesScope: 1011;
|
|
115
|
+
/**
|
|
116
|
+
* TSP1012: Parallel functions cannot have parameters.
|
|
117
|
+
*
|
|
118
|
+
* Functions used in signal.all() cannot have parameters because they
|
|
119
|
+
* are executed in parallel without specific arguments.
|
|
120
|
+
*
|
|
121
|
+
* Wrong: `signal.all([async (x) => { await signal(...) }])`
|
|
122
|
+
* Right: `signal.all([async () => { await signal(...) }])`
|
|
123
|
+
*/
|
|
124
|
+
readonly ParallelFunctionWithParams: 1012;
|
|
125
|
+
/**
|
|
126
|
+
* TSP1013: While-loop condition contains a suspension point.
|
|
127
|
+
*
|
|
128
|
+
* The compiler cannot suspend inside a while-loop condition because
|
|
129
|
+
* the condition is re-evaluated on each iteration before the loop body.
|
|
130
|
+
* Move the suspension into the loop body with an explicit break.
|
|
131
|
+
*
|
|
132
|
+
* Wrong: `while (await signal(svc.hasMore)) { ... }`
|
|
133
|
+
* Right: `while (true) { if (!await signal(svc.hasMore)) break; ... }`
|
|
134
|
+
*/
|
|
135
|
+
readonly WhileConditionSuspension: 1013;
|
|
136
|
+
/**
|
|
137
|
+
* TSP1014: Do-while loops with suspension points are not supported.
|
|
138
|
+
*
|
|
139
|
+
* The compiler does not yet support do-while loops containing
|
|
140
|
+
* suspension points. Convert to a while(true) loop with a break.
|
|
141
|
+
*
|
|
142
|
+
* Wrong: `do { await signal(svc.event) } while (condition)`
|
|
143
|
+
* Right: `while (true) { await signal(svc.event); if (!condition) break }`
|
|
144
|
+
*/
|
|
145
|
+
readonly DoWhileWithSuspension: 1014;
|
|
146
|
+
/**
|
|
147
|
+
* TSP1015: Classic for loops with suspension points are not supported.
|
|
148
|
+
*
|
|
149
|
+
* The compiler cannot make classic for(;;) loops durable because the
|
|
150
|
+
* incrementor and condition expressions would need to be re-evaluated
|
|
151
|
+
* on resume. Convert to a while loop with explicit counter management.
|
|
152
|
+
*
|
|
153
|
+
* Wrong: `for (let i = 0; i < n; i++) { await signal(...) }`
|
|
154
|
+
* Right: `let i = 0; while (i < n) { await signal(...); i++ }`
|
|
155
|
+
*/
|
|
156
|
+
readonly ForWithSuspension: 1015;
|
|
157
|
+
/**
|
|
158
|
+
* TSP2001: Recursion depth cannot be determined statically.
|
|
159
|
+
*
|
|
160
|
+
* The compiler must inline inner functions into the parent state machine.
|
|
161
|
+
* Recursive calls require static bounds to prevent infinite expansion.
|
|
162
|
+
*
|
|
163
|
+
* Wrong: `function recurse(n) { if (n > 0) await recurse(n - 1) }`
|
|
164
|
+
* Right: Use a while loop or bounded recursion with a constant limit.
|
|
165
|
+
*/
|
|
166
|
+
readonly RecursionDepthUnknown: 2001;
|
|
167
|
+
/**
|
|
168
|
+
* TSP2002: Mutual recursion detected.
|
|
169
|
+
*
|
|
170
|
+
* Two or more functions that call each other cannot be inlined into
|
|
171
|
+
* a state machine. The compiler cannot determine the call order.
|
|
172
|
+
*
|
|
173
|
+
* Wrong: `function a() { b() } function b() { a() }`
|
|
174
|
+
* Right: Restructure to use a single function or loop.
|
|
175
|
+
*/
|
|
176
|
+
readonly MutualRecursion: 2002;
|
|
177
|
+
/**
|
|
178
|
+
* TSP2003: Maximum inlining depth exceeded.
|
|
179
|
+
*
|
|
180
|
+
* The nested function call depth exceeds the maximum allowed for
|
|
181
|
+
* inlining (default: 10 levels). This prevents state machine explosion.
|
|
182
|
+
*/
|
|
183
|
+
readonly MaxInliningDepthExceeded: 2003;
|
|
184
|
+
/**
|
|
185
|
+
* TSP3001: Invalid durable iterator (missing ORDER BY).
|
|
186
|
+
*
|
|
187
|
+
* Repository queries used in for-of loops must have an ORDER BY clause
|
|
188
|
+
* with at least one unique column for keyset pagination to work.
|
|
189
|
+
*/
|
|
190
|
+
readonly InvalidDurableIterator: 3001;
|
|
191
|
+
/**
|
|
192
|
+
* TSP3002: Non-serializable cursor type.
|
|
193
|
+
*
|
|
194
|
+
* Durable iterators must produce serializable cursors (strings, numbers,
|
|
195
|
+
* or objects of primitives). Complex objects cannot be persisted.
|
|
196
|
+
*/
|
|
197
|
+
readonly NonSerializableCursor: 3002;
|
|
198
|
+
/**
|
|
199
|
+
* TSP3003: Yield in non-generator handler.
|
|
200
|
+
*
|
|
201
|
+
* The `yield` expression can only be used in async generator handlers
|
|
202
|
+
* declared with `async *handler()`. Regular async handlers cannot yield.
|
|
203
|
+
*
|
|
204
|
+
* Wrong: `async handler() { yield event }`
|
|
205
|
+
* Right: `async *handler() { yield event }`
|
|
206
|
+
*/
|
|
207
|
+
readonly YieldInNonGenerator: 3003;
|
|
208
|
+
/**
|
|
209
|
+
* TSP3004: Throw statement not allowed in process handler.
|
|
210
|
+
*
|
|
211
|
+
* Process handlers should return error results instead of throwing.
|
|
212
|
+
* Thrown exceptions break the durable execution model.
|
|
213
|
+
*
|
|
214
|
+
* Wrong: `throw new Error('failed')`
|
|
215
|
+
* Right: `return { status: 'error', message: 'failed' }`
|
|
216
|
+
*/
|
|
217
|
+
readonly ThrowNotAllowed: 3004;
|
|
218
|
+
/**
|
|
219
|
+
* TSP3005: signal.all() with empty array literal.
|
|
220
|
+
*
|
|
221
|
+
* Parallel blocks must have at least one branch.
|
|
222
|
+
*
|
|
223
|
+
* Wrong: `await signal.all([])`
|
|
224
|
+
* Right: `await signal.all([svc.a, svc.b])`
|
|
225
|
+
*/
|
|
226
|
+
readonly EmptyParallelBlock: 3005;
|
|
227
|
+
/**
|
|
228
|
+
* TSP3006: scope() exceeded item limit.
|
|
229
|
+
*
|
|
230
|
+
* The scope() function limits the number of entities to prevent
|
|
231
|
+
* state explosion. Default limit is 1000 items.
|
|
232
|
+
*/
|
|
233
|
+
readonly ScopeItemLimitExceeded: 3006;
|
|
234
|
+
/**
|
|
235
|
+
* TSP3007: Scope handler cannot yield.
|
|
236
|
+
*
|
|
237
|
+
* Handlers inside scope() cannot use yield. To emit events from
|
|
238
|
+
* scoped processing, use a process reference with subprocess.
|
|
239
|
+
*
|
|
240
|
+
* Wrong: `scope(items, async (item) => { yield item })`
|
|
241
|
+
* Right: `scope(processRef, items)`
|
|
242
|
+
*/
|
|
243
|
+
readonly ScopeHandlerCannotYield: 3007;
|
|
244
|
+
/**
|
|
245
|
+
* TSP3008: Duplicate entity in scope.
|
|
246
|
+
*
|
|
247
|
+
* Each entity in a scope() call must have a unique identity.
|
|
248
|
+
* Duplicate IDs would create conflicting execution paths.
|
|
249
|
+
*/
|
|
250
|
+
readonly DuplicateEntityInScope: 3008;
|
|
251
|
+
/**
|
|
252
|
+
* TSP3009: Nested scope collision.
|
|
253
|
+
*
|
|
254
|
+
* Cannot nest scope() calls with the same model type. This would
|
|
255
|
+
* create ambiguous identity paths.
|
|
256
|
+
*/
|
|
257
|
+
readonly NestedScopeCollision: 3009;
|
|
258
|
+
/**
|
|
259
|
+
* TSP3010: Race switch has no valid branches.
|
|
260
|
+
*
|
|
261
|
+
* A race switch must have at least one signal or delay branch.
|
|
262
|
+
* An empty switch would suspend indefinitely.
|
|
263
|
+
*
|
|
264
|
+
* Wrong: `const r = race(); switch (true) { default: break }`
|
|
265
|
+
* Right: `const r = race(); switch (true) { case signal(r, svc.a): ... }`
|
|
266
|
+
*/
|
|
267
|
+
readonly EmptyRace: 3010;
|
|
268
|
+
/**
|
|
269
|
+
* TSP3011: Invalid scope() arguments.
|
|
270
|
+
*
|
|
271
|
+
* scope() requires at least 2 arguments in one of these forms:
|
|
272
|
+
* - scope(signal, entities)
|
|
273
|
+
* - scope(entities, handler)
|
|
274
|
+
* - scope(entities, idFn, handler)
|
|
275
|
+
*/
|
|
276
|
+
readonly InvalidScopeArguments: 3011;
|
|
277
|
+
/**
|
|
278
|
+
* TSP3012: signal.all / signal.settled / stream inside race switch.
|
|
279
|
+
*
|
|
280
|
+
* These combinators are not yet supported as case expressions in a race
|
|
281
|
+
* switch. Use them as standalone awaits outside of a race, or use plain
|
|
282
|
+
* signal(r, ...) / delay(r, ...) branches.
|
|
283
|
+
*
|
|
284
|
+
* Wrong: `case signal.all(r, [svc.a, svc.b]):`
|
|
285
|
+
* Right: `case signal(r, svc.a):` or `const result = await signal.all([svc.a, svc.b])`
|
|
286
|
+
*/
|
|
287
|
+
readonly RaceCombinatorNotSupported: 3012;
|
|
288
|
+
/**
|
|
289
|
+
* TSP3013: Variable shadowing in process handler.
|
|
290
|
+
*
|
|
291
|
+
* Process state is serialized to a flat `state.vars.{name}` namespace.
|
|
292
|
+
* Block-scoped redeclarations (`const x = 1; { const x = 99 }`) collapse
|
|
293
|
+
* onto the same storage slot — the inner binding silently overwrites the
|
|
294
|
+
* outer, breaking lexical scope semantics. Function-parameter shadowing
|
|
295
|
+
* is fine (parameters live in their own activation record); this error
|
|
296
|
+
* is only for declarations that share a flat scope with the outer binding.
|
|
297
|
+
*
|
|
298
|
+
* Wrong: `const x = 1; { const x = 99; ... }`
|
|
299
|
+
* Right: `const x = 1; { const innerX = 99; ... }`
|
|
300
|
+
*/
|
|
301
|
+
readonly ShadowedHandlerLocal: 3013;
|
|
302
|
+
};
|
|
303
|
+
export type ProcessErrorCode = (typeof ProcessErrorCode)[keyof typeof ProcessErrorCode];
|
|
304
|
+
/**
|
|
305
|
+
* Create a process-specific diagnostic.
|
|
306
|
+
*/
|
|
307
|
+
export declare function createProcessDiagnostic(code: ProcessErrorCode, node: ts.Node, ...args: string[]): ts.Diagnostic;
|
|
308
|
+
/**
|
|
309
|
+
* Format error code for display.
|
|
310
|
+
*/
|
|
311
|
+
export declare function formatErrorCode(code: ProcessErrorCode): string;
|
|
312
|
+
/**
|
|
313
|
+
* Check if a diagnostic is a process-specific error.
|
|
314
|
+
*/
|
|
315
|
+
export declare function isProcessDiagnostic(diagnostic: ts.Diagnostic): boolean;
|
|
316
|
+
/**
|
|
317
|
+
* Get the process error code from a diagnostic.
|
|
318
|
+
*/
|
|
319
|
+
export declare function getProcessErrorCode(diagnostic: ts.Diagnostic): ProcessErrorCode | null;
|
|
320
|
+
/**
|
|
321
|
+
* Collector for process diagnostics during compilation.
|
|
322
|
+
*/
|
|
323
|
+
export declare class DiagnosticCollector {
|
|
324
|
+
private diagnostics;
|
|
325
|
+
add(code: ProcessErrorCode, node: ts.Node, ...args: string[]): void;
|
|
326
|
+
getAll(): ts.Diagnostic[];
|
|
327
|
+
hasErrors(): boolean;
|
|
328
|
+
clear(): void;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Filter TS2850 diagnostics for `using exports` declarations in process files.
|
|
332
|
+
* TS2850 fires because the exports object doesn't have Symbol.dispose, but
|
|
333
|
+
* our compiler handles disposal separately - this diagnostic is noise.
|
|
334
|
+
*/
|
|
335
|
+
export declare function filterUsingExportsDiagnostics(diagnostics: ts.Diagnostic[]): ts.Diagnostic[];
|
|
336
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/compiler/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B;;;GAGG;AACH,eAAO,MAAM,gBAAgB;IAC3B;;;;;;;;;OASG;;IAGH;;;;;;;OAOG;;IAGH;;;;OAIG;;IAGH;;OAEG;;IAGH;;;;;OAKG;;IAGH;;;;;;;;;;;OAWG;;IAGH;;;;;;;;;OASG;;IAGH;;;;;;;;;OASG;;IAGH;;;;;;;;;OASG;;IAGH;;;;;;;;;OASG;;IAGH;;;;;;;;;OASG;;IAGH;;;;;;;;OAQG;;IAGH;;;;;;;;;OASG;;IAGH;;;;;;;;OAQG;;IAGH;;;;;;;;;OASG;;IAGH;;;;;;;;OAQG;;IAGH;;;;;;;;OAQG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;;;;OAQG;;IAGH;;;;;;;;OAQG;;IAGH;;;;;;;OAOG;;IAGH;;;;;OAKG;;IAGH;;;;;;;;OAQG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;;;;OAQG;;IAGH;;;;;;;OAOG;;IAGH;;;;;;;;;OASG;;IAGH;;;;;;;;;;;;OAYG;;CAEK,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAiIxF;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,gBAAgB,EACtB,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,GAAG,IAAI,EAAE,MAAM,EAAE,GAChB,EAAE,CAAC,UAAU,CAoBf;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAE9D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,GAAG,OAAO,CAEtE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,GAAG,gBAAgB,GAAG,IAAI,CAGtF;AAGD;;GAEG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,WAAW,CAAuB;IAE1C,GAAG,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI;IAInE,MAAM,IAAI,EAAE,CAAC,UAAU,EAAE;IAIzB,SAAS,IAAI,OAAO;IAIpB,KAAK,IAAI,IAAI;CAGd;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,WAAW,EAAE,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,CAqB3F"}
|