@powerlines/deepkit 0.6.167 → 0.7.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.
Files changed (137) hide show
  1. package/bin/deepkit-install.cjs +55 -90
  2. package/dist/capnp-BLx1WTBU.cjs +5175 -0
  3. package/dist/capnp-BiGNkOmV.mjs +4905 -0
  4. package/dist/capnp.cjs +47 -186
  5. package/dist/capnp.d.cts +78 -77
  6. package/dist/{capnp.d.ts → capnp.d.mts} +78 -77
  7. package/dist/capnp.mjs +3 -0
  8. package/dist/chunk-C0xms8kb.cjs +34 -0
  9. package/dist/esbuild-plugin.cjs +47 -11
  10. package/dist/esbuild-plugin.d.cts +20 -18
  11. package/dist/esbuild-plugin.d.mts +35 -0
  12. package/dist/esbuild-plugin.mjs +48 -0
  13. package/dist/index.cjs +69 -250
  14. package/dist/index.d.cts +10 -19
  15. package/dist/index.d.mts +10 -0
  16. package/dist/index.mjs +11 -0
  17. package/dist/reflect-type.cjs +24 -12
  18. package/dist/reflect-type.d.cts +7 -5
  19. package/dist/{reflect-type.d.ts → reflect-type.d.mts} +7 -5
  20. package/dist/reflect-type.mjs +24 -0
  21. package/dist/{reflection-9KUpjPqV.d.cts → reflection-BwdnCwaK.d.cts} +11 -17
  22. package/dist/{reflection-9KUpjPqV.d.ts → reflection-D9R8cdSo.d.mts} +26 -32
  23. package/dist/resolve-reflections.cjs +15 -9
  24. package/dist/resolve-reflections.d.cts +4 -2
  25. package/dist/{resolve-reflections.d.ts → resolve-reflections.d.mts} +4 -2
  26. package/dist/resolve-reflections.mjs +16 -0
  27. package/dist/rolldown-plugin.cjs +44 -11
  28. package/dist/rolldown-plugin.d.cts +5 -3
  29. package/dist/{rolldown-plugin.d.ts → rolldown-plugin.d.mts} +5 -3
  30. package/dist/rolldown-plugin.mjs +45 -0
  31. package/dist/transformer.cjs +52 -13
  32. package/dist/transformer.d.cts +6 -4
  33. package/dist/{transformer.d.ts → transformer.d.mts} +6 -4
  34. package/dist/transformer.mjs +51 -0
  35. package/dist/transpile.cjs +29 -10
  36. package/dist/transpile.d.cts +6 -4
  37. package/dist/{transpile.d.ts → transpile.d.mts} +6 -4
  38. package/dist/transpile.mjs +29 -0
  39. package/dist/types.cjs +0 -4
  40. package/dist/types.d.cts +9 -9
  41. package/dist/{types.d.ts → types.d.mts} +9 -9
  42. package/dist/types.mjs +1 -0
  43. package/dist/utilities.cjs +116 -33
  44. package/dist/utilities.d.cts +4 -2
  45. package/dist/{utilities.d.ts → utilities.d.mts} +4 -2
  46. package/dist/utilities.mjs +111 -0
  47. package/dist/vendor/core.cjs +1240 -513
  48. package/dist/vendor/core.mjs +1116 -0
  49. package/dist/vendor/string-BoXo0wS7.cjs +2983 -0
  50. package/dist/vendor/string-BuMgdahD.mjs +2467 -0
  51. package/dist/vendor/type-BMLjRtLY.cjs +202 -0
  52. package/dist/vendor/type-Dgeqs-rL.mjs +190 -0
  53. package/dist/vendor/type-compiler/compiler-BUrWMhGi.cjs +6792 -0
  54. package/dist/vendor/type-compiler/compiler-Bg8jX6qU.mjs +6739 -0
  55. package/dist/vendor/type-compiler/compiler-D1z5h1MK.d.cts +578 -0
  56. package/dist/vendor/type-compiler/compiler-Nkxc4PLJ.d.mts +578 -0
  57. package/dist/vendor/type-compiler/compiler.cjs +11 -43
  58. package/dist/vendor/type-compiler/compiler.d.cts +2 -3
  59. package/dist/vendor/type-compiler/compiler.d.mts +2 -0
  60. package/dist/vendor/type-compiler/compiler.mjs +3 -0
  61. package/dist/vendor/type-compiler/config-BEX924PC.cjs +3709 -0
  62. package/dist/vendor/type-compiler/config-B_cKkYZm.d.cts +116 -0
  63. package/dist/vendor/type-compiler/config-D9DM7Du_.d.mts +116 -0
  64. package/dist/vendor/type-compiler/config-y0HNkbCH.mjs +3640 -0
  65. package/dist/vendor/type-compiler/config.cjs +9 -34
  66. package/dist/vendor/type-compiler/config.d.cts +2 -1
  67. package/dist/vendor/type-compiler/config.d.mts +2 -0
  68. package/dist/vendor/type-compiler/config.mjs +3 -0
  69. package/dist/vendor/type-compiler/index.cjs +56 -129
  70. package/dist/vendor/type-compiler/index.d.cts +22 -3
  71. package/dist/vendor/type-compiler/index.d.mts +22 -0
  72. package/dist/vendor/type-compiler/index.mjs +50 -0
  73. package/dist/vendor/type-spec.cjs +11 -12
  74. package/dist/vendor/type-spec.mjs +3 -0
  75. package/dist/vendor/type.cjs +8407 -17892
  76. package/dist/vendor/type.d.cts +10 -196
  77. package/dist/vendor/{type.d.ts → type.d.mts} +10 -196
  78. package/dist/vendor/type.mjs +9109 -0
  79. package/package.json +43 -31
  80. package/schemas/reflection.cjs +4018 -4129
  81. package/schemas/reflection.d.cts +30 -38
  82. package/schemas/{reflection.d.ts → reflection.d.mts} +30 -38
  83. package/schemas/reflection.mjs +4036 -0
  84. package/dist/capnp.js +0 -2
  85. package/dist/chunk-23YNDVRG.js +0 -34
  86. package/dist/chunk-27RKMKSF.cjs +0 -50
  87. package/dist/chunk-2XDQUCXZ.js +0 -2392
  88. package/dist/chunk-34OFD7LS.cjs +0 -68
  89. package/dist/chunk-7FXYDYVQ.cjs +0 -5246
  90. package/dist/chunk-7QZGCBH7.cjs +0 -11
  91. package/dist/chunk-ALM6UMVU.js +0 -9
  92. package/dist/chunk-BLLXF42T.cjs +0 -41
  93. package/dist/chunk-H3Q3XL3D.js +0 -19
  94. package/dist/chunk-HPVJ6OV3.cjs +0 -31
  95. package/dist/chunk-JQUKKAFM.js +0 -48
  96. package/dist/chunk-KK7TQA7L.cjs +0 -25
  97. package/dist/chunk-NPV2346T.js +0 -25
  98. package/dist/chunk-ORA4UQMU.cjs +0 -2
  99. package/dist/chunk-OUGDFUKJ.cjs +0 -2400
  100. package/dist/chunk-OULCUN6I.js +0 -1
  101. package/dist/chunk-SHUYVCID.js +0 -4
  102. package/dist/chunk-TDYIUJGY.js +0 -5180
  103. package/dist/chunk-USNT2KNT.cjs +0 -6
  104. package/dist/chunk-WYEFKIRL.js +0 -66
  105. package/dist/esbuild-plugin.d.ts +0 -33
  106. package/dist/esbuild-plugin.js +0 -4
  107. package/dist/index.d.ts +0 -19
  108. package/dist/index.js +0 -10
  109. package/dist/reflect-type.js +0 -5
  110. package/dist/resolve-reflections.js +0 -2
  111. package/dist/rolldown-plugin.js +0 -4
  112. package/dist/transformer.js +0 -2
  113. package/dist/transpile.js +0 -3
  114. package/dist/types.js +0 -1
  115. package/dist/utilities.js +0 -2
  116. package/dist/vendor/chunk-5BKT4CS5.js +0 -28
  117. package/dist/vendor/chunk-BLN7QVCP.js +0 -3704
  118. package/dist/vendor/chunk-BR2FK5K7.js +0 -109
  119. package/dist/vendor/chunk-EPQZMVJO.cjs +0 -3859
  120. package/dist/vendor/chunk-IFK6AU6M.cjs +0 -42
  121. package/dist/vendor/chunk-SHDAXCXF.cjs +0 -115
  122. package/dist/vendor/core.js +0 -2
  123. package/dist/vendor/type-compiler/chunk-3LL3TSRJ.js +0 -3762
  124. package/dist/vendor/type-compiler/chunk-CUTGHVNY.js +0 -7100
  125. package/dist/vendor/type-compiler/chunk-IAWCLVUK.cjs +0 -3780
  126. package/dist/vendor/type-compiler/chunk-UIWPG352.cjs +0 -7114
  127. package/dist/vendor/type-compiler/compiler.d.ts +0 -3
  128. package/dist/vendor/type-compiler/compiler.js +0 -5
  129. package/dist/vendor/type-compiler/config.d.ts +0 -1
  130. package/dist/vendor/type-compiler/config.js +0 -5
  131. package/dist/vendor/type-compiler/index.d.ts +0 -3
  132. package/dist/vendor/type-compiler/index.js +0 -66
  133. package/dist/vendor/type-spec.js +0 -2
  134. package/dist/vendor/type.js +0 -18359
  135. package/schemas/reflection.js +0 -4153
  136. /package/dist/vendor/{core.d.ts → core.d.mts} +0 -0
  137. /package/dist/vendor/{type-spec.d.ts → type-spec.d.mts} +0 -0
@@ -0,0 +1,578 @@
1
+ import { c as ReflectionConfig, i as MatchResult, l as ReflectionConfigCache, t as ConfigResolver } from "./config-D9DM7Du_.mjs";
2
+ import ts, { ArrowFunction, Bundle, ClassDeclaration, ClassExpression, CompilerHost, CompilerOptions, ConstructorDeclaration, CustomTransformer, CustomTransformerFactory, Declaration, EntityName, ExportDeclaration, Expression, ExpressionWithTypeArguments, FunctionDeclaration, FunctionExpression, Identifier, ImportDeclaration, JSDocImportTag, MethodDeclaration, ModuleDeclaration, ModuleExportName, Node, NodeFactory, ParseConfigHost, PropertyAccessExpression, QualifiedName, ResolvedModule, ScriptKind, SourceFile, Statement, StringLiteral, Symbol as Symbol$1, SymbolTable, TransformationContext, TypeAliasDeclaration, TypeChecker, TypeParameterDeclaration, TypeReferenceNode } from "typescript";
3
+
4
+ //#region ../../node_modules/.pnpm/@deepkit+type-spec@1.0.1_patch_hash=f3c3a4fd486751022d78f17d39a5a79f493bca20b185964ca1aba41fbfc93244/node_modules/@deepkit/type-spec/dist/cjs/src/type.d.ts
5
+ /**
6
+ * The instruction set.
7
+ * Should not be greater than 93 members, because we encode it via charCode starting at 33. +93 means we end up with charCode=126
8
+ * (which is '~' and the last char that can be represented without \x. The next 127 is '\x7F').
9
+ */
10
+ declare enum ReflectionOp {
11
+ never = 0,
12
+ any = 1,
13
+ unknown = 2,
14
+ void = 3,
15
+ object = 4,
16
+ string = 5,
17
+ number = 6,
18
+ numberBrand = 7,
19
+ boolean = 8,
20
+ bigint = 9,
21
+ symbol = 10,
22
+ null = 11,
23
+ undefined = 12,
24
+ /**
25
+ * The literal type of string, number, or boolean.
26
+ *
27
+ * This OP has 1 parameter. The next byte is the absolute address of the literal on the stack, which is the actual literal value.
28
+ *
29
+ * Pushes a function type.
30
+ */
31
+ literal = 13,
32
+ /**
33
+ * This OP pops all types on the current stack frame.
34
+ *
35
+ * This OP has 1 parameter. The next byte is the absolute address of a string|number|symbol entry on the stack.
36
+ *
37
+ * Pushes a function type.
38
+ */
39
+ function = 14,
40
+ /**
41
+ * This OP pops all types on the current stack frame.
42
+ *
43
+ * Pushes a method type.
44
+ */
45
+ method = 15,
46
+ methodSignature = 16,
47
+ //has 1 parameter, reference to stack for its property name
48
+ parameter = 17,
49
+ /**
50
+ * This OP pops the latest type entry on the stack.
51
+ *
52
+ * Pushes a property type.
53
+ */
54
+ property = 18,
55
+ propertySignature = 19,
56
+ //has 1 parameter, reference to stack for its property name
57
+ /**
58
+ * This OP pops all types on the current stack frame. Those types should be method|property.
59
+ *
60
+ * Pushes a TypeClass onto the stack.
61
+ */
62
+ class = 20,
63
+ /**
64
+ * If a class extends another class with generics, this OP represents the generic type arguments of the super class.
65
+ *
66
+ * e.g. `class A extends B<string, boolean>`, string and boolean are on the stack and classExtends pops() them, and then assigns to A.extendsTypeArguments = [string, boolean].
67
+ *
68
+ * This is only emitted when the class that is currently being described actually extends another class and uses generics.
69
+ *
70
+ * This OP has 1 argument and pops x types from the stack. X is the first argument.
71
+ * Expects a TypeClass on the stack.
72
+ */
73
+ classExtends = 21,
74
+ /**
75
+ * This OP has 1 parameter, the stack entry to the actual class symbol.
76
+ */
77
+ classReference = 22,
78
+ /**
79
+ * Marks the last entry in the stack as optional. Used for method|property. Equal to the QuestionMark operator in a property assignment.
80
+ */
81
+ optional = 23,
82
+ readonly = 24,
83
+ public = 25,
84
+ private = 26,
85
+ protected = 27,
86
+ abstract = 28,
87
+ defaultValue = 29,
88
+ description = 30,
89
+ rest = 31,
90
+ regexp = 32,
91
+ enum = 33,
92
+ enumMember = 34,
93
+ //has one argument, the name.
94
+ set = 35,
95
+ map = 36,
96
+ /**
97
+ * Pops the latest stack entry and uses it as T for an array type.
98
+ *
99
+ * Pushes an array type.
100
+ */
101
+ array = 37,
102
+ tuple = 38,
103
+ tupleMember = 39,
104
+ namedTupleMember = 40,
105
+ //has one argument, the name.
106
+ union = 41,
107
+ //pops frame. requires frame start when stack can be dirty.
108
+ intersection = 42,
109
+ indexSignature = 43,
110
+ objectLiteral = 44,
111
+ mappedType = 45,
112
+ //2 parameters: functionPointer and modifier.
113
+ in = 46,
114
+ frame = 47,
115
+ //creates a new stack frame
116
+ moveFrame = 48,
117
+ //pop() as T, pops the current stack frame, push(T)
118
+ return = 49,
119
+ templateLiteral = 50,
120
+ date = 51,
121
+ int8Array = 52,
122
+ uint8ClampedArray = 53,
123
+ uint8Array = 54,
124
+ int16Array = 55,
125
+ uint16Array = 56,
126
+ int32Array = 57,
127
+ uint32Array = 58,
128
+ float32Array = 59,
129
+ float64Array = 60,
130
+ bigInt64Array = 61,
131
+ arrayBuffer = 62,
132
+ promise = 63,
133
+ arg = 64,
134
+ //@deprecated. parameter is a number referencing an entry in the stack, relative to the beginning of the current frame, *-1. pushes that entry onto the stack. this is related to the calling convention.
135
+ typeParameter = 65,
136
+ //generic type parameter, e.g. T in a generic. has 1 parameter: reference to the name.
137
+ typeParameterDefault = 66,
138
+ //generic type parameter with a default value, e.g. T in a generic. has 1 parameter: reference to the name. pop() for the default value
139
+ var = 67,
140
+ //reserve a new variable in the stack
141
+ loads = 68,
142
+ //pushes to the stack a referenced value in the stack. has 2 parameters: <frame> <index>, frame is a negative offset to the frame, and index the index of the stack entry withing the referenced frame
143
+ indexAccess = 69,
144
+ //T['string'], 2 items on the stack
145
+ keyof = 70,
146
+ //keyof operator
147
+ infer = 71,
148
+ //2 params, like `loads`
149
+ typeof = 72,
150
+ //1 parameter that points to a function returning the runtime value from which we need to extract the type
151
+ condition = 73,
152
+ jumpCondition = 74,
153
+ //@deprecated. used when INFER is used in `extends` conditional branch. 2 args: left program, right program
154
+ jump = 75,
155
+ //jump to an address
156
+ call = 76,
157
+ //has one parameter, the next program address. creates a new stack frame with current program address as first stack entry, and jumps back to that + 1.
158
+ inline = 77,
159
+ inlineCall = 78,
160
+ distribute = 79,
161
+ //has one parameter, the co-routine program index.
162
+ extends = 80,
163
+ //X extends Y in a conditional type, XY popped from the stack, pushes boolean on the stack
164
+ widen = 81,
165
+ //widens the type on the stack, .e.g 'asd' => string, 34 => number, etc. this is necessary for infer runtime data, and widen if necessary (object member or non-contained literal)
166
+ static = 82,
167
+ mappedType2 = 83,
168
+ //same as mappedType2 but the given functionPointer returns a tuple [type, name]
169
+ functionReference = 84,
170
+ //Same as classReference but for functions
171
+ callSignature = 85,
172
+ //Same as function but for call signatures (in object literals)
173
+ /**
174
+ * Assign for Enum, Interface, Class, and TypeAlias declaration at the very end
175
+ * of the program the typeName. This is so that we have type names available even
176
+ * if the JS code is minified.
177
+ *
178
+ * his operator also assigns originTypes to the type, as it acts as the finalization
179
+ * step of a type.
180
+ */
181
+ typeName = 86,
182
+ //has one parameter, the index of the stack entry that contains the type name. Uses current head of the stack as type and assigns typeName to it.
183
+ /**
184
+ * If a class implement an interface or type,
185
+ *
186
+ * e.g. `class A implements B`, then B is on the stack and implements pops() it, and then assigns to A.implements = [B].
187
+ *
188
+ * This is only emitted when the class that is currently being described actually implements something.
189
+ *
190
+ * This OP has 1 argument and pops x types from the stack. X is the first argument.
191
+ * Expects a TypeClass on the stack.
192
+ */
193
+ implements = 87,
194
+ //pops one type from the stack and assigns it to the latest class on the stack as `implements` type.
195
+ nominal = 88,
196
+ //marks the last type on the stack as nominal. (used at the end of class/interface/type alias programs).
197
+ /**
198
+ * Custom Storm Software operators
199
+ */
200
+ tags = 89
201
+ }
202
+ //#endregion
203
+ //#region ../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=439aa6e683a9a48c3ebbf3529be5811680c45c22d6a265d_be73b50bc43bac944747b8ca0498113a/node_modules/@deepkit/type-compiler/dist/cjs/src/ts-types.d.ts
204
+ /**
205
+ * Contains @internal properties that are not yet in the public API of TS.
206
+ */
207
+ interface SourceFile$1 extends SourceFile {
208
+ /**
209
+ * If two source files are for the same version of the same package, one will redirect to the other.
210
+ * (See `createRedirectSourceFile` in program.ts.)
211
+ * The redirect will have this set. The redirected-to source file will be in `redirectTargetsMap`.
212
+ */
213
+ redirectInfo?: any;
214
+ scriptKind?: ScriptKind;
215
+ externalModuleIndicator?: Node;
216
+ commonJsModuleIndicator?: Node;
217
+ jsGlobalAugmentations?: SymbolTable;
218
+ symbol?: Symbol$1;
219
+ }
220
+ //#endregion
221
+ //#region ../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=439aa6e683a9a48c3ebbf3529be5811680c45c22d6a265d_be73b50bc43bac944747b8ca0498113a/node_modules/@deepkit/type-compiler/dist/cjs/src/reflection-ast.d.ts
222
+ type PackExpression = Expression | string | number | boolean | bigint;
223
+ declare class NodeConverter {
224
+ protected f: NodeFactory;
225
+ constructor(f: NodeFactory);
226
+ toExpression<T extends PackExpression | PackExpression[]>(node?: T): Expression;
227
+ }
228
+ //#endregion
229
+ //#region ../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=439aa6e683a9a48c3ebbf3529be5811680c45c22d6a265d_be73b50bc43bac944747b8ca0498113a/node_modules/@deepkit/type-compiler/dist/cjs/src/resolver.d.ts
230
+ /**
231
+ * A utility to resolve a module path and its declaration.
232
+ *
233
+ * It automatically reads a SourceFile, binds and caches it.
234
+ */
235
+ declare class Resolver {
236
+ compilerOptions: CompilerOptions;
237
+ host: CompilerHost;
238
+ protected sourceFiles: {
239
+ [fileName: string]: SourceFile;
240
+ };
241
+ constructor(compilerOptions: CompilerOptions, host: CompilerHost, sourceFiles: {
242
+ [fileName: string]: SourceFile;
243
+ });
244
+ resolve(from: SourceFile, importOrExportNode: ExportDeclaration | ImportDeclaration | JSDocImportTag): SourceFile | undefined;
245
+ protected resolveImpl(modulePath: StringLiteral, sourceFile: SourceFile): ResolvedModule | undefined;
246
+ /**
247
+ * Tries to resolve the .ts/d.ts file path for a given module path.
248
+ * Scans relative paths. Looks into package.json "types" and "exports" (with new 4.7 support)
249
+ *
250
+ * @param sourceFile the SourceFile of the file that contains the import. modulePath is relative to that.
251
+ * @param modulePath the x in 'from x'.
252
+ */
253
+ resolveSourceFile(sourceFile: SourceFile, modulePath: StringLiteral): SourceFile | undefined;
254
+ }
255
+ //#endregion
256
+ //#region ../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=439aa6e683a9a48c3ebbf3529be5811680c45c22d6a265d_be73b50bc43bac944747b8ca0498113a/node_modules/@deepkit/type-compiler/dist/cjs/src/compiler.d.ts
257
+ declare function encodeOps(ops: ReflectionOp[]): string;
258
+ declare const packSizeByte: number;
259
+ /**
260
+ * It can't be more ops than this given number
261
+ */
262
+ declare const packSize: number;
263
+ interface TagsReflectionStruct {
264
+ hidden?: boolean;
265
+ ignore?: boolean;
266
+ internal?: boolean;
267
+ runtime?: boolean;
268
+ alias?: string[];
269
+ title?: string;
270
+ permission?: string[];
271
+ domain?: string;
272
+ }
273
+ declare function debugPackStruct(sourceFile: SourceFile$1, forType: Node, pack: {
274
+ ops: ReflectionOp[];
275
+ stack: PackExpression[];
276
+ }): void;
277
+ interface Frame {
278
+ variables: {
279
+ name: string;
280
+ index: number;
281
+ }[];
282
+ opIndex: number;
283
+ conditional?: true;
284
+ previous?: Frame;
285
+ }
286
+ type StackEntry = Expression | string | number | boolean;
287
+ declare class CompilerProgram {
288
+ forNode: Node;
289
+ sourceFile?: SourceFile$1 | undefined;
290
+ protected ops: ReflectionOp[];
291
+ protected stack: StackEntry[];
292
+ protected mainOffset: number;
293
+ protected stackPosition: number;
294
+ protected frame: Frame;
295
+ protected activeCoRoutines: {
296
+ ops: ReflectionOp[];
297
+ }[];
298
+ protected coRoutines: {
299
+ ops: ReflectionOp[];
300
+ }[];
301
+ constructor(forNode: Node, sourceFile?: SourceFile$1 | undefined);
302
+ buildPackStruct(): {
303
+ ops: ReflectionOp[];
304
+ stack: StackEntry[];
305
+ };
306
+ isEmpty(): boolean;
307
+ pushConditionalFrame(): void;
308
+ pushStack(item: StackEntry): number;
309
+ pushCoRoutine(): void;
310
+ popCoRoutine(): number;
311
+ pushOp(...ops: ReflectionOp[]): void;
312
+ pushOpAtFrame(frame: Frame, ...ops: ReflectionOp[]): void;
313
+ /**
314
+ * Returns the index of the `entry` in the stack, if already exists. If not, add it, and return that new index.
315
+ */
316
+ findOrAddStackEntry(entry: any): number;
317
+ /**
318
+ * To make room for a stack entry expected on the stack as input for example.
319
+ */
320
+ increaseStackPosition(): number;
321
+ protected resolveFunctionParameters: Map<ts.Node, number>;
322
+ resolveFunctionParametersIncrease(fn: Node): void;
323
+ resolveFunctionParametersDecrease(fn: Node): void;
324
+ isResolveFunctionParameters(fn: Node): boolean;
325
+ /**
326
+ *
327
+ * Each pushFrame() call needs a popFrame() call.
328
+ */
329
+ pushFrame(implicit?: boolean): Frame;
330
+ findConditionalFrame(): Frame | undefined;
331
+ /**
332
+ * Remove stack without doing it as OP in the processor. Some other command calls popFrame() already, which makes popFrameImplicit() an implicit popFrame.
333
+ * e.g. union, class, etc. all call popFrame(). the current CompilerProgram needs to be aware of that, which this function is for.
334
+ */
335
+ popFrameImplicit(): void;
336
+ moveFrame(): void;
337
+ pushVariable(name: string, frame?: Frame): number;
338
+ pushTemplateParameter(name: string, withDefault?: boolean): number;
339
+ findVariable(name: string, frame?: Frame): {
340
+ frameOffset: number;
341
+ stackIndex: number;
342
+ } | undefined;
343
+ }
344
+ declare class Cache {
345
+ resolver: ReflectionConfigCache;
346
+ sourceFiles: {
347
+ [fileName: string]: SourceFile$1;
348
+ };
349
+ globalSourceFiles?: SourceFile$1[];
350
+ /**
351
+ * Signals the cache to check if it needs to be cleared.
352
+ */
353
+ tick(): void;
354
+ }
355
+ /**
356
+ * Read the TypeScript AST and generate pack struct (instructions + pre-defined stack).
357
+ *
358
+ * This transformer extracts type and add the encoded (so its small and low overhead) at classes and functions as property.
359
+ *
360
+ * Deepkit/type can then extract and decode them on-demand.
361
+ */
362
+ declare class ReflectionTransformer implements CustomTransformer {
363
+ protected context: TransformationContext;
364
+ protected cache: Cache;
365
+ sourceFile: SourceFile$1;
366
+ protected f: NodeFactory;
367
+ protected embedAssignType: boolean;
368
+ /**
369
+ * Types added to this map will get a type program directly under it.
370
+ * This is for types used in the very same file.
371
+ */
372
+ protected compileDeclarations: Map<ts.TypeAliasDeclaration | ts.InterfaceDeclaration | ts.EnumDeclaration, {
373
+ name: EntityName;
374
+ sourceFile: SourceFile$1;
375
+ compiled?: Statement[];
376
+ }>;
377
+ /**
378
+ * Types added to this map will get a type program at the top root level of the program.
379
+ * This is for imported types, which need to be inlined into the current file, as we do not emit type imports (TS will omit them).
380
+ */
381
+ protected embedDeclarations: Map<ts.Node, {
382
+ name: EntityName;
383
+ sourceFile?: SourceFile$1;
384
+ }>;
385
+ /**
386
+ * When a node was embedded or compiled (from the maps above), we store it here to know to not add it again.
387
+ */
388
+ protected compiledDeclarations: Set<ts.Node>;
389
+ protected addImports: {
390
+ from: Expression;
391
+ identifier: Identifier;
392
+ }[];
393
+ protected nodeConverter: NodeConverter;
394
+ protected typeChecker?: TypeChecker;
395
+ protected resolver: Resolver;
396
+ protected host: CompilerHost;
397
+ protected overriddenHost: boolean;
398
+ protected overriddenConfigResolver?: ConfigResolver;
399
+ protected compilerOptions: CompilerOptions;
400
+ /**
401
+ * When a deep call expression was found a script-wide variable is necessary
402
+ * as temporary storage.
403
+ */
404
+ protected tempResultIdentifier?: Identifier;
405
+ protected parseConfigHost: ParseConfigHost;
406
+ protected intrinsicMetaDeclaration: TypeAliasDeclaration;
407
+ constructor(context: TransformationContext, cache?: Cache);
408
+ forHost(host: CompilerHost): this;
409
+ withReflection(config: ReflectionConfig): this;
410
+ transformBundle(node: Bundle): Bundle;
411
+ getTempResultIdentifier(): Identifier;
412
+ protected getConfigResolver(sourceFile: {
413
+ fileName: string;
414
+ }): ConfigResolver;
415
+ protected getReflectionConfig(sourceFile: {
416
+ fileName: string;
417
+ }): MatchResult;
418
+ protected isWithReflection(sourceFile: SourceFile$1 | undefined, node: Node & {
419
+ __deepkitConfig?: ReflectionConfig;
420
+ }): boolean;
421
+ transformSourceFile(sourceFile: SourceFile$1): SourceFile$1;
422
+ protected getModuleType(): "cjs" | "esm";
423
+ protected getArrowFunctionΩPropertyAccessIdentifier(node: ArrowFunction): Identifier | undefined;
424
+ protected injectResetΩ<T extends FunctionDeclaration | FunctionExpression | MethodDeclaration | ConstructorDeclaration | ArrowFunction>(node: T): T;
425
+ protected createProgramVarFromNode(node: Node, name: EntityName, sourceFile?: SourceFile$1): Statement[];
426
+ protected extractPackStructOfExpression(node: Expression, program: CompilerProgram): void;
427
+ protected parseDefaultValue(kind: ts.SyntaxKind, defaultValue: string): any;
428
+ protected parseTagReflection(node: Node | Declaration | ClassDeclaration | ClassExpression): TagsReflectionStruct;
429
+ protected extractTagReflections(program: CompilerProgram, node?: Node): void;
430
+ protected extractDefaultValueReflection(program: CompilerProgram, node?: Node): void;
431
+ protected extractDescriptionReflection(program: CompilerProgram, node?: Node): void;
432
+ protected extractPackStructOfType(node: Node | Declaration | ClassDeclaration | ClassExpression, program: CompilerProgram): void;
433
+ protected knownClasses: {
434
+ [name: string]: ReflectionOp;
435
+ };
436
+ protected getGlobalLibs(): SourceFile$1[];
437
+ /**
438
+ * This is a custom resolver based on populated `locals` from the binder. It uses a custom resolution algorithm since
439
+ * we have no access to the binder/TypeChecker directly and instantiating a TypeChecker per file/transformer is incredible slow.
440
+ */
441
+ protected resolveDeclaration(typeName: EntityName): {
442
+ declaration: Node;
443
+ importDeclaration?: ImportDeclaration | JSDocImportTag;
444
+ typeOnly?: boolean;
445
+ } | void;
446
+ protected getDeclarationVariableName(typeName: EntityName): Identifier;
447
+ /**
448
+ * The semantic of isExcluded is different from checking if the fileName is part
449
+ * of reflection config option. isExcluded checks if the file should be excluded
450
+ * via the exclude option. mainly used to exclude globals and external libraries.
451
+ */
452
+ protected isExcluded(fileName: string): boolean;
453
+ protected extractPackStructOfTypeReference(type: TypeReferenceNode | ExpressionWithTypeArguments, program: CompilerProgram): void;
454
+ /**
455
+ * Returns the class declaration, function/arrow declaration, or block where type was used.
456
+ */
457
+ protected getTypeUser(type: Node): Node;
458
+ /**
459
+ * With this function we want to check if `type` is used in the signature itself from the parent of `declaration`.
460
+ * If so, we do not try to infer the type from runtime values.
461
+ *
462
+ * Examples where we do not infer from runtime, `type` being `T` and `declaration` being `<T>` (return false):
463
+ *
464
+ * ```typescript
465
+ * class User<T> {
466
+ * config: T;
467
+ * }
468
+ *
469
+ * class User<T> {
470
+ * constructor(public config: T) {}
471
+ * }
472
+ *
473
+ * function do<T>(item: T): void {}
474
+ * function do<T>(item: T): T {}
475
+ * ```
476
+ *
477
+ * Examples where we infer from runtime (return true):
478
+ *
479
+ * ```typescript
480
+ * function do<T>(item: T) {
481
+ * return typeOf<T>; //<-- because of that
482
+ * }
483
+ *
484
+ * function do<T>(item: T) {
485
+ * class A {
486
+ * config: T; //<-- because of that
487
+ * }
488
+ * return A;
489
+ * }
490
+ *
491
+ * function do<T>(item: T) {
492
+ * class A {
493
+ * doIt() {
494
+ * class B {
495
+ * config: T; //<-- because of that
496
+ * }
497
+ * return B;
498
+ * }
499
+ * }
500
+ * return A;
501
+ * }
502
+ *
503
+ * function do<T>(item: T) {
504
+ * class A {
505
+ * doIt(): T { //<-- because of that
506
+ * }
507
+ * }
508
+ * return A;
509
+ * }
510
+ * ```
511
+ */
512
+ protected needsToBeInferred(declaration: TypeParameterDeclaration, type: TypeReferenceNode | ExpressionWithTypeArguments): boolean;
513
+ protected resolveTypeOnlyImport(entityName: EntityName, program: CompilerProgram): void;
514
+ protected resolveTypeName(typeName: string, program: CompilerProgram): void;
515
+ protected resolveTypeParameter(declaration: TypeParameterDeclaration, type: TypeReferenceNode | ExpressionWithTypeArguments, program: CompilerProgram): void;
516
+ protected createAccessorForEntityName(e: QualifiedName): PropertyAccessExpression;
517
+ protected findDeclarationInFile(sourceFile: SourceFile$1 | ModuleDeclaration, declarationName: string): Declaration | undefined;
518
+ protected resolveImportSpecifier(_declarationName: string | ModuleExportName, importOrExport: ExportDeclaration | ImportDeclaration | JSDocImportTag, sourceFile: SourceFile$1): Declaration | undefined;
519
+ protected followExport(declarationName: string, statement: ExportDeclaration, sourceFile: SourceFile$1): Declaration | undefined;
520
+ protected getTypeOfType(type: Node | Declaration): Expression | undefined;
521
+ protected packOpsAndStack(program: CompilerProgram): ts.Expression | undefined;
522
+ /**
523
+ * Note: We have to duplicate the expressions as it can be that incoming expression are from another file and contain wrong pos/end properties,
524
+ * so the code generation is then broken when we simply reuse them. Wrong code like ``User.__type = [.toEqual({`` is then generated.
525
+ * This function is probably not complete, but we add new copies when required.
526
+ */
527
+ protected valueToExpression(value: undefined | PackExpression | PackExpression[]): Expression;
528
+ /**
529
+ * A class is decorated with type information by adding a static variable.
530
+ *
531
+ * class Model {
532
+ * static __types = pack(ReflectionOp.string); //<-- encoded type information
533
+ * title: string;
534
+ * }
535
+ */
536
+ protected decorateClass(sourceFile: SourceFile$1, node: ClassDeclaration | ClassExpression): Node;
537
+ /**
538
+ * const fn = function() {}
539
+ *
540
+ * => const fn = __assignType(function() {}, [34])
541
+ */
542
+ protected decorateFunctionExpression(expression: FunctionExpression): ts.FunctionExpression | ts.CallExpression;
543
+ /**
544
+ * function name() {}
545
+ *
546
+ * => function name() {}; name.__type = 34;
547
+ */
548
+ protected decorateFunctionDeclaration(declaration: FunctionDeclaration): ts.Statement[] | ts.FunctionDeclaration | ts.ExportAssignment | undefined;
549
+ /**
550
+ * const fn = () => {}
551
+ * => const fn = __assignType(() => {}, [34])
552
+ */
553
+ protected decorateArrowFunction(expression: ArrowFunction): ts.CallExpression | ts.ArrowFunction;
554
+ /**
555
+ * Object.assign(fn, {__type: []}) is much slower than a custom implementation like
556
+ *
557
+ * assignType(fn, [])
558
+ *
559
+ * where we embed assignType() at the beginning of the type.
560
+ */
561
+ protected wrapWithAssignType(fn: Expression, type: Expression): ts.CallExpression;
562
+ /**
563
+ * Checks if reflection was disabled/enabled in file via JSDoc attribute for a particular
564
+ * Node, e.g `@reflection no`. If nothing is found, "reflection" config option needs to be used.
565
+ */
566
+ protected getExplicitReflectionMode(sourceFile: SourceFile$1 | undefined, node: Node): boolean | undefined;
567
+ }
568
+ declare class DeclarationTransformer extends ReflectionTransformer {
569
+ protected addExports: {
570
+ identifier: string;
571
+ }[];
572
+ transformSourceFile(sourceFile: SourceFile$1): SourceFile$1;
573
+ }
574
+ declare const transformer: CustomTransformerFactory;
575
+ declare const declarationTransformer: CustomTransformerFactory;
576
+ //#endregion
577
+ export { debugPackStruct as a, packSize as c, TagsReflectionStruct as i, packSizeByte as l, DeclarationTransformer as n, declarationTransformer as o, ReflectionTransformer as r, encodeOps as s, Cache as t, transformer as u };
578
+ //# sourceMappingURL=compiler-Nkxc4PLJ.d.mts.map
@@ -1,44 +1,12 @@
1
- 'use strict';
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_compiler = require('./compiler-BUrWMhGi.cjs');
2
3
 
3
- var chunkUIWPG352_cjs = require('./chunk-UIWPG352.cjs');
4
- var chunkIAWCLVUK_cjs = require('./chunk-IAWCLVUK.cjs');
5
-
6
- // src/vendor/type-compiler/compiler.ts
7
- chunkIAWCLVUK_cjs.init_cjs_shims();
8
-
9
- Object.defineProperty(exports, "Cache", {
10
- enumerable: true,
11
- get: function () { return chunkUIWPG352_cjs.Cache; }
12
- });
13
- Object.defineProperty(exports, "DeclarationTransformer", {
14
- enumerable: true,
15
- get: function () { return chunkUIWPG352_cjs.DeclarationTransformer; }
16
- });
17
- Object.defineProperty(exports, "ReflectionTransformer", {
18
- enumerable: true,
19
- get: function () { return chunkUIWPG352_cjs.ReflectionTransformer; }
20
- });
21
- Object.defineProperty(exports, "debugPackStruct", {
22
- enumerable: true,
23
- get: function () { return chunkUIWPG352_cjs.debugPackStruct; }
24
- });
25
- Object.defineProperty(exports, "declarationTransformer", {
26
- enumerable: true,
27
- get: function () { return chunkUIWPG352_cjs.declarationTransformer; }
28
- });
29
- Object.defineProperty(exports, "encodeOps", {
30
- enumerable: true,
31
- get: function () { return chunkUIWPG352_cjs.encodeOps; }
32
- });
33
- Object.defineProperty(exports, "packSize", {
34
- enumerable: true,
35
- get: function () { return chunkUIWPG352_cjs.packSize; }
36
- });
37
- Object.defineProperty(exports, "packSizeByte", {
38
- enumerable: true,
39
- get: function () { return chunkUIWPG352_cjs.packSizeByte; }
40
- });
41
- Object.defineProperty(exports, "transformer", {
42
- enumerable: true,
43
- get: function () { return chunkUIWPG352_cjs.transformer; }
44
- });
4
+ exports.Cache = require_compiler.Cache;
5
+ exports.DeclarationTransformer = require_compiler.DeclarationTransformer;
6
+ exports.ReflectionTransformer = require_compiler.ReflectionTransformer;
7
+ exports.debugPackStruct = require_compiler.debugPackStruct;
8
+ exports.declarationTransformer = require_compiler.declarationTransformer;
9
+ exports.encodeOps = require_compiler.encodeOps;
10
+ exports.packSize = require_compiler.packSize;
11
+ exports.packSizeByte = require_compiler.packSizeByte;
12
+ exports.transformer = require_compiler.transformer;
@@ -1,3 +1,2 @@
1
- export * from '@deepkit/type-compiler/compiler';
2
- import '@deepkit/type-compiler/config';
3
- import '@deepkit/type-compiler';
1
+ import { a as debugPackStruct, c as packSize, i as TagsReflectionStruct, l as packSizeByte, n as DeclarationTransformer, o as declarationTransformer, r as ReflectionTransformer, s as encodeOps, t as Cache, u as transformer } from "./compiler-D1z5h1MK.cjs";
2
+ export { Cache, DeclarationTransformer, ReflectionTransformer, TagsReflectionStruct, debugPackStruct, declarationTransformer, encodeOps, packSize, packSizeByte, transformer };
@@ -0,0 +1,2 @@
1
+ import { a as debugPackStruct, c as packSize, i as TagsReflectionStruct, l as packSizeByte, n as DeclarationTransformer, o as declarationTransformer, r as ReflectionTransformer, s as encodeOps, t as Cache, u as transformer } from "./compiler-Nkxc4PLJ.mjs";
2
+ export { Cache, DeclarationTransformer, ReflectionTransformer, TagsReflectionStruct, debugPackStruct, declarationTransformer, encodeOps, packSize, packSizeByte, transformer };
@@ -0,0 +1,3 @@
1
+ import { a as declarationTransformer, c as packSizeByte, i as debugPackStruct, l as transformer, n as DeclarationTransformer, o as encodeOps, r as ReflectionTransformer, s as packSize, t as Cache } from "./compiler-Bg8jX6qU.mjs";
2
+
3
+ export { Cache, DeclarationTransformer, ReflectionTransformer, debugPackStruct, declarationTransformer, encodeOps, packSize, packSizeByte, transformer };