whet 0.0.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 +47 -0
- package/bin/HxOverrides.d.ts +8 -0
- package/bin/HxOverrides.js +54 -0
- package/bin/Lambda.d.ts +86 -0
- package/bin/Lambda.js +141 -0
- package/bin/Map.d.ts +5 -0
- package/bin/Reflect.d.ts +19 -0
- package/bin/Reflect.js +41 -0
- package/bin/Std.d.ts +49 -0
- package/bin/Std.js +96 -0
- package/bin/StdTypes.d.ts +57 -0
- package/bin/StringTools.d.ts +23 -0
- package/bin/StringTools.js +36 -0
- package/bin/commander/AddHelpTextContext.d.ts +6 -0
- package/bin/commander/AddHelpTextPosition.d.ts +2 -0
- package/bin/commander/CommandOptions.d.ts +6 -0
- package/bin/commander/ErrorOptions.d.ts +11 -0
- package/bin/commander/ExecutableCommandOptions.d.ts +7 -0
- package/bin/commander/HelpContext.d.ts +4 -0
- package/bin/commander/HookEvent.d.ts +2 -0
- package/bin/commander/OptionValueSource.d.ts +2 -0
- package/bin/commander/OutputConfiguration.d.ts +8 -0
- package/bin/commander/ParseOptions.d.ts +4 -0
- package/bin/commander/ParseOptionsResult.d.ts +5 -0
- package/bin/genes/Register.d.ts +15 -0
- package/bin/genes/Register.js +107 -0
- package/bin/genes/util/EsMap.d.ts +12 -0
- package/bin/genes/util/EsMap.js +51 -0
- package/bin/haxe/Constraints.d.ts +8 -0
- package/bin/haxe/Constraints.js +5 -0
- package/bin/haxe/Exception.d.ts +66 -0
- package/bin/haxe/Exception.js +88 -0
- package/bin/haxe/NativeStackTrace.d.ts +7 -0
- package/bin/haxe/PosInfos.d.ts +19 -0
- package/bin/haxe/Rest.d.ts +2 -0
- package/bin/haxe/ValueException.d.ts +24 -0
- package/bin/haxe/ValueException.js +36 -0
- package/bin/haxe/crypto/Crc32.d.ts +12 -0
- package/bin/haxe/crypto/Crc32.js +40 -0
- package/bin/haxe/ds/List.d.ts +31 -0
- package/bin/haxe/ds/List.js +55 -0
- package/bin/haxe/ds/ObjectMap.d.ts +7 -0
- package/bin/haxe/ds/ObjectMap.js +25 -0
- package/bin/haxe/ds/StringMap.d.ts +6 -0
- package/bin/haxe/ds/StringMap.js +25 -0
- package/bin/haxe/exceptions/NotImplementedException.d.ts +10 -0
- package/bin/haxe/exceptions/NotImplementedException.js +27 -0
- package/bin/haxe/exceptions/PosException.d.ts +19 -0
- package/bin/haxe/exceptions/PosException.js +36 -0
- package/bin/haxe/extern/Rest.d.ts +11 -0
- package/bin/haxe/io/ArrayBufferView.d.ts +2 -0
- package/bin/haxe/io/Bytes.d.ts +19 -0
- package/bin/haxe/io/Bytes.js +78 -0
- package/bin/haxe/io/BytesBuffer.d.ts +19 -0
- package/bin/haxe/io/BytesBuffer.js +67 -0
- package/bin/haxe/io/BytesData.d.ts +2 -0
- package/bin/haxe/io/BytesOutput.d.ts +18 -0
- package/bin/haxe/io/BytesOutput.js +39 -0
- package/bin/haxe/io/Encoding.d.ts +20 -0
- package/bin/haxe/io/Encoding.js +20 -0
- package/bin/haxe/io/Error.d.ts +35 -0
- package/bin/haxe/io/Error.js +31 -0
- package/bin/haxe/io/Output.d.ts +63 -0
- package/bin/haxe/io/Output.js +126 -0
- package/bin/haxe/io/Path.d.ts +109 -0
- package/bin/haxe/io/Path.js +217 -0
- package/bin/haxe/io/UInt8Array.d.ts +2 -0
- package/bin/haxe/iterators/ArrayIterator.d.ts +19 -0
- package/bin/haxe/iterators/ArrayIterator.js +35 -0
- package/bin/haxe/macro/Expr.d.ts +331 -0
- package/bin/haxe/macro/Type.d.ts +609 -0
- package/bin/haxe/zip/Compress.d.ts +5 -0
- package/bin/haxe/zip/Compress.js +21 -0
- package/bin/haxe/zip/Entry.d.ts +27 -0
- package/bin/haxe/zip/Entry.js +15 -0
- package/bin/haxe/zip/Tools.d.ts +5 -0
- package/bin/haxe/zip/Tools.js +24 -0
- package/bin/haxe/zip/Writer.d.ts +22 -0
- package/bin/haxe/zip/Writer.js +149 -0
- package/bin/js/Boot.d.ts +18 -0
- package/bin/js/Boot.js +225 -0
- package/bin/js/Node.d.ts +6 -0
- package/bin/js/lib/ArrayBuffer.d.ts +4 -0
- package/bin/js/lib/ArrayBuffer.js +24 -0
- package/bin/js/lib/Iterator.d.ts +23 -0
- package/bin/js/lib/Map.d.ts +2 -0
- package/bin/js/lib/Object.d.ts +82 -0
- package/bin/js/lib/Promise.d.ts +10 -0
- package/bin/js/lib/intl/NumberFormat.d.ts +114 -0
- package/bin/js/node/Buffer.d.ts +3 -0
- package/bin/js/node/ChildProcess.d.ts +424 -0
- package/bin/js/node/Crypto.d.ts +21 -0
- package/bin/js/node/Dns.d.ts +57 -0
- package/bin/js/node/Fs.d.ts +308 -0
- package/bin/js/node/Http.d.ts +114 -0
- package/bin/js/node/Https.d.ts +330 -0
- package/bin/js/node/Iterator.d.ts +5 -0
- package/bin/js/node/Path.d.ts +44 -0
- package/bin/js/node/Process.d.ts +6 -0
- package/bin/js/node/Tls.d.ts +304 -0
- package/bin/js/node/Url.d.ts +126 -0
- package/bin/js/node/Util.d.ts +115 -0
- package/bin/js/node/Zlib.d.ts +29 -0
- package/bin/js/node/buffer/Buffer.d.ts +23 -0
- package/bin/js/node/buffer/Buffer.js +24 -0
- package/bin/js/node/child_process/ChildProcess.d.ts +11 -0
- package/bin/js/node/console/Console.d.ts +26 -0
- package/bin/js/node/http/Agent.d.ts +40 -0
- package/bin/js/node/http/ClientRequest.d.ts +10 -0
- package/bin/js/node/https/Agent.d.ts +50 -0
- package/bin/js/node/net/Server.d.ts +22 -0
- package/bin/js/node/net/Socket.d.ts +101 -0
- package/bin/js/node/stream/Duplex.d.ts +86 -0
- package/bin/js/node/stream/Readable.d.ts +41 -0
- package/bin/js/node/stream/Transform.d.ts +92 -0
- package/bin/js/node/stream/Writable.d.ts +57 -0
- package/bin/js/node/tls/SecureContext.d.ts +74 -0
- package/bin/js/node/tls/TLSSocket.d.ts +47 -0
- package/bin/ts/Undefined.d.ts +5 -0
- package/bin/whet/Log.d.ts +16 -0
- package/bin/whet/Log.js +106 -0
- package/bin/whet/Project.d.ts +33 -0
- package/bin/whet/Project.js +71 -0
- package/bin/whet/Source.d.ts +51 -0
- package/bin/whet/Source.js +136 -0
- package/bin/whet/SourceHash.d.ts +15 -0
- package/bin/whet/SourceHash.js +68 -0
- package/bin/whet/SourceId.d.ts +10 -0
- package/bin/whet/SourceId.js +74 -0
- package/bin/whet/Stone.d.ts +88 -0
- package/bin/whet/Stone.js +157 -0
- package/bin/whet/Utils.d.ts +16 -0
- package/bin/whet/Utils.js +72 -0
- package/bin/whet/Whet.d.ts +4 -0
- package/bin/whet/Whet.js +117 -0
- package/bin/whet/cache/BaseCache.d.ts +27 -0
- package/bin/whet/cache/BaseCache.js +210 -0
- package/bin/whet/cache/Cache.d.ts +72 -0
- package/bin/whet/cache/Cache.js +57 -0
- package/bin/whet/cache/CacheManager.d.ts +23 -0
- package/bin/whet/cache/CacheManager.js +103 -0
- package/bin/whet/cache/FileCache.d.ts +35 -0
- package/bin/whet/cache/FileCache.js +295 -0
- package/bin/whet/cache/MemoryCache.d.ts +12 -0
- package/bin/whet/cache/MemoryCache.js +58 -0
- package/bin/whet/magic/MaybeArray.d.ts +4 -0
- package/bin/whet/magic/MaybeArray.js +25 -0
- package/bin/whet/magic/RoutePathType.d.ts +9 -0
- package/bin/whet/magic/RoutePathType.js +48 -0
- package/bin/whet/magic/RouteType.d.ts +12 -0
- package/bin/whet/magic/RouteType.js +70 -0
- package/bin/whet/magic/StoneId.d.ts +5 -0
- package/bin/whet/magic/StoneId.js +32 -0
- package/bin/whet/route/Route.d.ts +15 -0
- package/bin/whet/route/Route.js +81 -0
- package/bin/whet/route/RouteResult.d.ts +22 -0
- package/bin/whet/route/RouteResult.js +25 -0
- package/bin/whet/route/Router.d.ts +33 -0
- package/bin/whet/route/Router.js +224 -0
- package/bin/whet/stones/Files.d.ts +28 -0
- package/bin/whet/stones/Files.js +86 -0
- package/bin/whet/stones/JsonStone.d.ts +33 -0
- package/bin/whet/stones/JsonStone.js +117 -0
- package/bin/whet/stones/RemoteFile.d.ts +28 -0
- package/bin/whet/stones/RemoteFile.js +71 -0
- package/bin/whet/stones/Server.d.ts +42 -0
- package/bin/whet/stones/Server.js +113 -0
- package/bin/whet/stones/Zip.d.ts +30 -0
- package/bin/whet/stones/Zip.js +111 -0
- package/bin/whet/stones/haxe/HaxeBuild.d.ts +34 -0
- package/bin/whet/stones/haxe/HaxeBuild.js +89 -0
- package/bin/whet/stones/haxe/Hxml.d.ts +102 -0
- package/bin/whet/stones/haxe/Hxml.js +348 -0
- package/bin/whet.d.ts +20 -0
- package/bin/whet.js +18 -0
- package/package.json +32 -0
|
@@ -0,0 +1,609 @@
|
|
|
1
|
+
import {Position, Binop, Unop, Expr, MetadataEntry} from "./Expr"
|
|
2
|
+
import {Map as Map__1} from "../../Map"
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
Represents a reference to internal compiler structure. It exists to avoid
|
|
6
|
+
expensive encoding if it is not required and to ensure that physical
|
|
7
|
+
equality remains intact.
|
|
8
|
+
|
|
9
|
+
A structure is only encoded when user requests it through `ref.get()`.
|
|
10
|
+
*/
|
|
11
|
+
export type Ref<T> = {
|
|
12
|
+
get: () => T,
|
|
13
|
+
toString: () => string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
Represents information for anonymous structure types.
|
|
18
|
+
*/
|
|
19
|
+
export type AnonType = {
|
|
20
|
+
/**
|
|
21
|
+
The class fields of the structure.
|
|
22
|
+
*/
|
|
23
|
+
fields: ClassField[],
|
|
24
|
+
/**
|
|
25
|
+
The status/kind of the structure.
|
|
26
|
+
*/
|
|
27
|
+
status: AnonStatus
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
Represents the declaration of type parameters.
|
|
32
|
+
*/
|
|
33
|
+
export type TypeParameter = {
|
|
34
|
+
/**
|
|
35
|
+
The name of the type parameter.
|
|
36
|
+
*/
|
|
37
|
+
name: string,
|
|
38
|
+
/**
|
|
39
|
+
The type of the type parameter. It is guaranteed to be a `TInst` with a
|
|
40
|
+
`KTypeParameter` kind.
|
|
41
|
+
*/
|
|
42
|
+
t: Type
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
Represents a class field.
|
|
47
|
+
*/
|
|
48
|
+
export type ClassField = {
|
|
49
|
+
/**
|
|
50
|
+
The associated documentation of the class field.
|
|
51
|
+
*/
|
|
52
|
+
doc: null | string,
|
|
53
|
+
/**
|
|
54
|
+
Returns the typed expression of the class field.
|
|
55
|
+
*/
|
|
56
|
+
expr: () => null | TypedExpr,
|
|
57
|
+
/**
|
|
58
|
+
Whether or not the class field is abstract.
|
|
59
|
+
*/
|
|
60
|
+
isAbstract: boolean,
|
|
61
|
+
/**
|
|
62
|
+
Whether or not the class field is extern.
|
|
63
|
+
*/
|
|
64
|
+
isExtern: boolean,
|
|
65
|
+
/**
|
|
66
|
+
Whether or not the class field is final.
|
|
67
|
+
*/
|
|
68
|
+
isFinal: boolean,
|
|
69
|
+
/**
|
|
70
|
+
Whether or not the class field is public.
|
|
71
|
+
*/
|
|
72
|
+
isPublic: boolean,
|
|
73
|
+
/**
|
|
74
|
+
The class field kind.
|
|
75
|
+
*/
|
|
76
|
+
kind: FieldKind,
|
|
77
|
+
/**
|
|
78
|
+
The metadata of the class field.
|
|
79
|
+
*/
|
|
80
|
+
meta: MetaAccess,
|
|
81
|
+
/**
|
|
82
|
+
The name of the class field.
|
|
83
|
+
*/
|
|
84
|
+
name: string,
|
|
85
|
+
/**
|
|
86
|
+
The overload fields of the class field.
|
|
87
|
+
*/
|
|
88
|
+
overloads: Ref<ClassField[]>,
|
|
89
|
+
/**
|
|
90
|
+
The type parameters of the class field.
|
|
91
|
+
*/
|
|
92
|
+
params: TypeParameter[],
|
|
93
|
+
/**
|
|
94
|
+
The position of the class field.
|
|
95
|
+
*/
|
|
96
|
+
pos: Position,
|
|
97
|
+
/**
|
|
98
|
+
The type of the class field.
|
|
99
|
+
*/
|
|
100
|
+
type: Type
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
Represents an enum constructor.
|
|
105
|
+
*/
|
|
106
|
+
export type EnumField = {
|
|
107
|
+
/**
|
|
108
|
+
The associated documentation of the enum constructor.
|
|
109
|
+
*/
|
|
110
|
+
doc: null | string,
|
|
111
|
+
/**
|
|
112
|
+
The index of the enum constructor, i.e. in which position it appears
|
|
113
|
+
in the syntax.
|
|
114
|
+
*/
|
|
115
|
+
index: number,
|
|
116
|
+
/**
|
|
117
|
+
The metadata of the enum constructor.
|
|
118
|
+
*/
|
|
119
|
+
meta: MetaAccess,
|
|
120
|
+
/**
|
|
121
|
+
The name of the enum constructor.
|
|
122
|
+
*/
|
|
123
|
+
name: string,
|
|
124
|
+
/**
|
|
125
|
+
The type parameters of the enum constructor.
|
|
126
|
+
*/
|
|
127
|
+
params: TypeParameter[],
|
|
128
|
+
/**
|
|
129
|
+
The position of the enum constructor.
|
|
130
|
+
*/
|
|
131
|
+
pos: Position,
|
|
132
|
+
/**
|
|
133
|
+
The type of the enum constructor.
|
|
134
|
+
*/
|
|
135
|
+
type: Type
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
The information that all types (`ClassType`, `EnumType`, `DefType`,
|
|
140
|
+
`AbstractType`) have in common.
|
|
141
|
+
*/
|
|
142
|
+
export type BaseType = {
|
|
143
|
+
/**
|
|
144
|
+
The associated documentation of the class field.
|
|
145
|
+
*/
|
|
146
|
+
doc: null | string,
|
|
147
|
+
/**
|
|
148
|
+
Allows excluding the type from compilation.
|
|
149
|
+
*/
|
|
150
|
+
exclude: () => void,
|
|
151
|
+
/**
|
|
152
|
+
Whether or not the type is extern.
|
|
153
|
+
*/
|
|
154
|
+
isExtern: boolean,
|
|
155
|
+
/**
|
|
156
|
+
Whether or not the type is private.
|
|
157
|
+
*/
|
|
158
|
+
isPrivate: boolean,
|
|
159
|
+
/**
|
|
160
|
+
The metadata of the type.
|
|
161
|
+
*/
|
|
162
|
+
meta: MetaAccess,
|
|
163
|
+
/**
|
|
164
|
+
The module name of the type, which might be different.
|
|
165
|
+
*/
|
|
166
|
+
module: string,
|
|
167
|
+
/**
|
|
168
|
+
The name of the type.
|
|
169
|
+
*/
|
|
170
|
+
name: string,
|
|
171
|
+
/**
|
|
172
|
+
The package of the type.
|
|
173
|
+
*/
|
|
174
|
+
pack: string[],
|
|
175
|
+
/**
|
|
176
|
+
The type parameters of the type.
|
|
177
|
+
*/
|
|
178
|
+
params: TypeParameter[],
|
|
179
|
+
/**
|
|
180
|
+
The position of the type.
|
|
181
|
+
*/
|
|
182
|
+
pos: Position
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
Represents a class type.
|
|
187
|
+
*/
|
|
188
|
+
export type ClassType = {
|
|
189
|
+
/**
|
|
190
|
+
The constructor of the class, if available.
|
|
191
|
+
*/
|
|
192
|
+
constructor: null | Ref<ClassField>,
|
|
193
|
+
/**
|
|
194
|
+
The associated documentation of the class field.
|
|
195
|
+
*/
|
|
196
|
+
doc: null | string,
|
|
197
|
+
/**
|
|
198
|
+
Allows excluding the type from compilation.
|
|
199
|
+
*/
|
|
200
|
+
exclude: () => void,
|
|
201
|
+
/**
|
|
202
|
+
The member fields of the class.
|
|
203
|
+
*/
|
|
204
|
+
fields: Ref<ClassField[]>,
|
|
205
|
+
/**
|
|
206
|
+
The `__init__` expression of the class, if available.
|
|
207
|
+
*/
|
|
208
|
+
init: null | TypedExpr,
|
|
209
|
+
/**
|
|
210
|
+
The implemented interfaces and their type parameters.
|
|
211
|
+
*/
|
|
212
|
+
interfaces: {
|
|
213
|
+
params: Type[],
|
|
214
|
+
t: Ref<ClassType>
|
|
215
|
+
}[],
|
|
216
|
+
/**
|
|
217
|
+
If true the class is abstract and cannot be instantiated directly.
|
|
218
|
+
*/
|
|
219
|
+
isAbstract: boolean,
|
|
220
|
+
/**
|
|
221
|
+
Whether or not the type is extern.
|
|
222
|
+
*/
|
|
223
|
+
isExtern: boolean,
|
|
224
|
+
/**
|
|
225
|
+
If true the class is final and cannot be extended.
|
|
226
|
+
*/
|
|
227
|
+
isFinal: boolean,
|
|
228
|
+
/**
|
|
229
|
+
If true the type is an interface, otherwise it is a class.
|
|
230
|
+
*/
|
|
231
|
+
isInterface: boolean,
|
|
232
|
+
/**
|
|
233
|
+
Whether or not the type is private.
|
|
234
|
+
*/
|
|
235
|
+
isPrivate: boolean,
|
|
236
|
+
/**
|
|
237
|
+
The kind of the class.
|
|
238
|
+
*/
|
|
239
|
+
kind: ClassKind,
|
|
240
|
+
/**
|
|
241
|
+
The metadata of the type.
|
|
242
|
+
*/
|
|
243
|
+
meta: MetaAccess,
|
|
244
|
+
/**
|
|
245
|
+
The module name of the type, which might be different.
|
|
246
|
+
*/
|
|
247
|
+
module: string,
|
|
248
|
+
/**
|
|
249
|
+
The name of the type.
|
|
250
|
+
*/
|
|
251
|
+
name: string,
|
|
252
|
+
/**
|
|
253
|
+
The list of fields that have override status.
|
|
254
|
+
*/
|
|
255
|
+
overrides: Ref<ClassField>[],
|
|
256
|
+
/**
|
|
257
|
+
The package of the type.
|
|
258
|
+
*/
|
|
259
|
+
pack: string[],
|
|
260
|
+
/**
|
|
261
|
+
The type parameters of the type.
|
|
262
|
+
*/
|
|
263
|
+
params: TypeParameter[],
|
|
264
|
+
/**
|
|
265
|
+
The position of the type.
|
|
266
|
+
*/
|
|
267
|
+
pos: Position,
|
|
268
|
+
/**
|
|
269
|
+
The static fields of the class.
|
|
270
|
+
*/
|
|
271
|
+
statics: Ref<ClassField[]>,
|
|
272
|
+
/**
|
|
273
|
+
The parent class and its type parameters, if available.
|
|
274
|
+
*/
|
|
275
|
+
superClass: null | {
|
|
276
|
+
params: Type[],
|
|
277
|
+
t: Ref<ClassType>
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
Represents an enum type.
|
|
283
|
+
*/
|
|
284
|
+
export type EnumType = {
|
|
285
|
+
/**
|
|
286
|
+
The available enum constructors.
|
|
287
|
+
*/
|
|
288
|
+
constructs: Map__1<string, EnumField>,
|
|
289
|
+
/**
|
|
290
|
+
The associated documentation of the class field.
|
|
291
|
+
*/
|
|
292
|
+
doc: null | string,
|
|
293
|
+
/**
|
|
294
|
+
Allows excluding the type from compilation.
|
|
295
|
+
*/
|
|
296
|
+
exclude: () => void,
|
|
297
|
+
/**
|
|
298
|
+
Whether or not the type is extern.
|
|
299
|
+
*/
|
|
300
|
+
isExtern: boolean,
|
|
301
|
+
/**
|
|
302
|
+
Whether or not the type is private.
|
|
303
|
+
*/
|
|
304
|
+
isPrivate: boolean,
|
|
305
|
+
/**
|
|
306
|
+
The metadata of the type.
|
|
307
|
+
*/
|
|
308
|
+
meta: MetaAccess,
|
|
309
|
+
/**
|
|
310
|
+
The module name of the type, which might be different.
|
|
311
|
+
*/
|
|
312
|
+
module: string,
|
|
313
|
+
/**
|
|
314
|
+
The name of the type.
|
|
315
|
+
*/
|
|
316
|
+
name: string,
|
|
317
|
+
/**
|
|
318
|
+
An ordered list of enum constructor names.
|
|
319
|
+
*/
|
|
320
|
+
names: string[],
|
|
321
|
+
/**
|
|
322
|
+
The package of the type.
|
|
323
|
+
*/
|
|
324
|
+
pack: string[],
|
|
325
|
+
/**
|
|
326
|
+
The type parameters of the type.
|
|
327
|
+
*/
|
|
328
|
+
params: TypeParameter[],
|
|
329
|
+
/**
|
|
330
|
+
The position of the type.
|
|
331
|
+
*/
|
|
332
|
+
pos: Position
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
Represents a typedef.
|
|
337
|
+
*/
|
|
338
|
+
export type DefType = {
|
|
339
|
+
/**
|
|
340
|
+
The associated documentation of the class field.
|
|
341
|
+
*/
|
|
342
|
+
doc: null | string,
|
|
343
|
+
/**
|
|
344
|
+
Allows excluding the type from compilation.
|
|
345
|
+
*/
|
|
346
|
+
exclude: () => void,
|
|
347
|
+
/**
|
|
348
|
+
Whether or not the type is extern.
|
|
349
|
+
*/
|
|
350
|
+
isExtern: boolean,
|
|
351
|
+
/**
|
|
352
|
+
Whether or not the type is private.
|
|
353
|
+
*/
|
|
354
|
+
isPrivate: boolean,
|
|
355
|
+
/**
|
|
356
|
+
The metadata of the type.
|
|
357
|
+
*/
|
|
358
|
+
meta: MetaAccess,
|
|
359
|
+
/**
|
|
360
|
+
The module name of the type, which might be different.
|
|
361
|
+
*/
|
|
362
|
+
module: string,
|
|
363
|
+
/**
|
|
364
|
+
The name of the type.
|
|
365
|
+
*/
|
|
366
|
+
name: string,
|
|
367
|
+
/**
|
|
368
|
+
The package of the type.
|
|
369
|
+
*/
|
|
370
|
+
pack: string[],
|
|
371
|
+
/**
|
|
372
|
+
The type parameters of the type.
|
|
373
|
+
*/
|
|
374
|
+
params: TypeParameter[],
|
|
375
|
+
/**
|
|
376
|
+
The position of the type.
|
|
377
|
+
*/
|
|
378
|
+
pos: Position,
|
|
379
|
+
/**
|
|
380
|
+
The target type of the typedef.
|
|
381
|
+
*/
|
|
382
|
+
type: Type
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
Represents an abstract type.
|
|
387
|
+
*/
|
|
388
|
+
export type AbstractType = {
|
|
389
|
+
/**
|
|
390
|
+
The defined array-access fields of the abstract.
|
|
391
|
+
*/
|
|
392
|
+
array: ClassField[],
|
|
393
|
+
/**
|
|
394
|
+
The defined binary operators of the abstract.
|
|
395
|
+
*/
|
|
396
|
+
binops: {
|
|
397
|
+
field: ClassField,
|
|
398
|
+
op: Binop
|
|
399
|
+
}[],
|
|
400
|
+
/**
|
|
401
|
+
The associated documentation of the class field.
|
|
402
|
+
*/
|
|
403
|
+
doc: null | string,
|
|
404
|
+
/**
|
|
405
|
+
Allows excluding the type from compilation.
|
|
406
|
+
*/
|
|
407
|
+
exclude: () => void,
|
|
408
|
+
/**
|
|
409
|
+
The available implicit from-casts of the abstract.
|
|
410
|
+
|
|
411
|
+
@see https://haxe.org/manual/types-abstract-implicit-casts.html
|
|
412
|
+
*/
|
|
413
|
+
from: {
|
|
414
|
+
field: null | ClassField,
|
|
415
|
+
t: Type
|
|
416
|
+
}[],
|
|
417
|
+
/**
|
|
418
|
+
The implementation class of the abstract, if available.
|
|
419
|
+
*/
|
|
420
|
+
impl: null | Ref<ClassType>,
|
|
421
|
+
/**
|
|
422
|
+
Whether or not the type is extern.
|
|
423
|
+
*/
|
|
424
|
+
isExtern: boolean,
|
|
425
|
+
/**
|
|
426
|
+
Whether or not the type is private.
|
|
427
|
+
*/
|
|
428
|
+
isPrivate: boolean,
|
|
429
|
+
/**
|
|
430
|
+
The metadata of the type.
|
|
431
|
+
*/
|
|
432
|
+
meta: MetaAccess,
|
|
433
|
+
/**
|
|
434
|
+
The module name of the type, which might be different.
|
|
435
|
+
*/
|
|
436
|
+
module: string,
|
|
437
|
+
/**
|
|
438
|
+
The name of the type.
|
|
439
|
+
*/
|
|
440
|
+
name: string,
|
|
441
|
+
/**
|
|
442
|
+
The package of the type.
|
|
443
|
+
*/
|
|
444
|
+
pack: string[],
|
|
445
|
+
/**
|
|
446
|
+
The type parameters of the type.
|
|
447
|
+
*/
|
|
448
|
+
params: TypeParameter[],
|
|
449
|
+
/**
|
|
450
|
+
The position of the type.
|
|
451
|
+
*/
|
|
452
|
+
pos: Position,
|
|
453
|
+
/**
|
|
454
|
+
The method used for resolving unknown field access, if available.
|
|
455
|
+
*/
|
|
456
|
+
resolve: null | ClassField,
|
|
457
|
+
/**
|
|
458
|
+
The method used for resolving unknown field access, if available.
|
|
459
|
+
*/
|
|
460
|
+
resolveWrite: null | ClassField,
|
|
461
|
+
/**
|
|
462
|
+
The available implicit to-casts of the abstract.
|
|
463
|
+
|
|
464
|
+
@see https://haxe.org/manual/types-abstract-implicit-casts.html
|
|
465
|
+
*/
|
|
466
|
+
to: {
|
|
467
|
+
field: null | ClassField,
|
|
468
|
+
t: Type
|
|
469
|
+
}[],
|
|
470
|
+
/**
|
|
471
|
+
The underlying type of the abstract.
|
|
472
|
+
*/
|
|
473
|
+
type: Type,
|
|
474
|
+
/**
|
|
475
|
+
The defined unary operators of the abstract.
|
|
476
|
+
*/
|
|
477
|
+
unops: {
|
|
478
|
+
field: ClassField,
|
|
479
|
+
op: Unop,
|
|
480
|
+
postFix: boolean
|
|
481
|
+
}[]
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
MetaAccess is a wrapper for the `Metadata` array. It can be used to add
|
|
486
|
+
metadata to and remove metadata from its origin.
|
|
487
|
+
*/
|
|
488
|
+
export type MetaAccess = {
|
|
489
|
+
/**
|
|
490
|
+
Adds the metadata specified by `name`, `params` and `pos` to the origin
|
|
491
|
+
of `this` MetaAccess.
|
|
492
|
+
|
|
493
|
+
Metadata names are not unique during compilation, so this method never
|
|
494
|
+
overwrites a previous metadata.
|
|
495
|
+
|
|
496
|
+
If a `Metadata` array is obtained through a call to `get`, a subsequent
|
|
497
|
+
call to `add` has no effect on that array.
|
|
498
|
+
|
|
499
|
+
If any argument is null, compilation fails with an error.
|
|
500
|
+
*/
|
|
501
|
+
add: (name: string, params: Expr[], pos: Position) => void,
|
|
502
|
+
/**
|
|
503
|
+
Extract metadata entries by given `name`.
|
|
504
|
+
|
|
505
|
+
If there's no metadata with such name, empty array `[]` is returned.
|
|
506
|
+
|
|
507
|
+
If `name` is null, compilation fails with an error.
|
|
508
|
+
*/
|
|
509
|
+
extract: (name: string) => MetadataEntry[],
|
|
510
|
+
/**
|
|
511
|
+
Return the wrapped `Metadata` array.
|
|
512
|
+
|
|
513
|
+
Modifying this array has no effect on the origin of `this` MetaAccess.
|
|
514
|
+
The `add` and `remove` methods can be used for that.
|
|
515
|
+
*/
|
|
516
|
+
get: () => MetadataEntry[],
|
|
517
|
+
/**
|
|
518
|
+
Tells if the origin of `this` MetaAccess has a `name` metadata entry.
|
|
519
|
+
|
|
520
|
+
If `name` is null, compilation fails with an error.
|
|
521
|
+
*/
|
|
522
|
+
has: (name: string) => boolean,
|
|
523
|
+
/**
|
|
524
|
+
Removes all `name` metadata entries from the origin of `this`
|
|
525
|
+
MetaAccess.
|
|
526
|
+
|
|
527
|
+
This method might clear several metadata entries of the same name.
|
|
528
|
+
|
|
529
|
+
If a `Metadata` array is obtained through a call to `get`, a subsequent
|
|
530
|
+
call to `remove` has no effect on that array.
|
|
531
|
+
|
|
532
|
+
If `name` is null, compilation fails with an error.
|
|
533
|
+
*/
|
|
534
|
+
remove: (name: string) => void
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
Represents a variable in the typed AST.
|
|
539
|
+
*/
|
|
540
|
+
export type TVar = {
|
|
541
|
+
/**
|
|
542
|
+
Whether or not the variable has been captured by a closure.
|
|
543
|
+
*/
|
|
544
|
+
capture: boolean,
|
|
545
|
+
/**
|
|
546
|
+
Special information which is internally used to keep track of closure.
|
|
547
|
+
information
|
|
548
|
+
*/
|
|
549
|
+
extra: null | {
|
|
550
|
+
expr: null | TypedExpr,
|
|
551
|
+
params: TypeParameter[]
|
|
552
|
+
},
|
|
553
|
+
/**
|
|
554
|
+
The unique ID of the variable.
|
|
555
|
+
*/
|
|
556
|
+
id: number,
|
|
557
|
+
/**
|
|
558
|
+
The metadata of the variable.
|
|
559
|
+
*/
|
|
560
|
+
meta: null | MetaAccess,
|
|
561
|
+
/**
|
|
562
|
+
The name of the variable.
|
|
563
|
+
*/
|
|
564
|
+
name: string,
|
|
565
|
+
/**
|
|
566
|
+
The type of the variable.
|
|
567
|
+
*/
|
|
568
|
+
t: Type
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
Represents a function in the typed AST.
|
|
573
|
+
*/
|
|
574
|
+
export type TFunc = {
|
|
575
|
+
/**
|
|
576
|
+
A list of function arguments identified by an argument variable `v` and
|
|
577
|
+
an optional initialization `value`.
|
|
578
|
+
*/
|
|
579
|
+
args: {
|
|
580
|
+
v: TVar,
|
|
581
|
+
value: null | TypedExpr
|
|
582
|
+
}[],
|
|
583
|
+
/**
|
|
584
|
+
The expression of the function body.
|
|
585
|
+
*/
|
|
586
|
+
expr: TypedExpr,
|
|
587
|
+
/**
|
|
588
|
+
The return type of the function.
|
|
589
|
+
*/
|
|
590
|
+
t: Type
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
Represents a typed AST node.
|
|
595
|
+
*/
|
|
596
|
+
export type TypedExpr = {
|
|
597
|
+
/**
|
|
598
|
+
The expression kind.
|
|
599
|
+
*/
|
|
600
|
+
expr: TypedExprDef,
|
|
601
|
+
/**
|
|
602
|
+
The position of the expression.
|
|
603
|
+
*/
|
|
604
|
+
pos: Position,
|
|
605
|
+
/**
|
|
606
|
+
The type of the expression.
|
|
607
|
+
*/
|
|
608
|
+
t: Type
|
|
609
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as Zlib from "zlib"
|
|
2
|
+
import {Helper} from "../../js/node/buffer/Buffer.js"
|
|
3
|
+
import {Register} from "../../genes/Register.js"
|
|
4
|
+
import {Buffer} from "buffer"
|
|
5
|
+
|
|
6
|
+
const $global = Register.$global
|
|
7
|
+
|
|
8
|
+
export const Compress = Register.global("$hxClasses")["haxe.zip.Compress"] =
|
|
9
|
+
class Compress {
|
|
10
|
+
static run(s, level) {
|
|
11
|
+
var data = s.b;
|
|
12
|
+
return Helper.bytesOfBuffer(Zlib.deflateSync(Buffer.from(data.buffer, data.byteOffset, s.length), {"level": level}));
|
|
13
|
+
}
|
|
14
|
+
static get __name__() {
|
|
15
|
+
return "haxe.zip.Compress"
|
|
16
|
+
}
|
|
17
|
+
get __class__() {
|
|
18
|
+
return Compress
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {Bytes} from "../io/Bytes"
|
|
2
|
+
import {List} from "../ds/List"
|
|
3
|
+
|
|
4
|
+
export declare namespace ExtraField {
|
|
5
|
+
export type FUtf8 = {_hx_index: 2, __enum__: "haxe.zip.ExtraField"}
|
|
6
|
+
export const FUtf8: FUtf8
|
|
7
|
+
export type FUnknown = {_hx_index: 0, tag: number, bytes: Bytes, __enum__: "haxe.zip.ExtraField"}
|
|
8
|
+
export const FUnknown: (tag: number, bytes: Bytes) => ExtraField
|
|
9
|
+
export type FInfoZipUnicodePath = {_hx_index: 1, name: string, crc: number, __enum__: "haxe.zip.ExtraField"}
|
|
10
|
+
export const FInfoZipUnicodePath: (name: string, crc: number) => ExtraField
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export declare type ExtraField =
|
|
14
|
+
| ExtraField.FUtf8
|
|
15
|
+
| ExtraField.FUnknown
|
|
16
|
+
| ExtraField.FInfoZipUnicodePath
|
|
17
|
+
|
|
18
|
+
export type Entry = {
|
|
19
|
+
compressed: boolean,
|
|
20
|
+
crc32: null | number,
|
|
21
|
+
data: null | Bytes,
|
|
22
|
+
dataSize: number,
|
|
23
|
+
extraFields?: null | List<ExtraField>,
|
|
24
|
+
fileName: string,
|
|
25
|
+
fileSize: number,
|
|
26
|
+
fileTime: Date
|
|
27
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {Register} from "../../genes/Register.js"
|
|
2
|
+
|
|
3
|
+
const $global = Register.$global
|
|
4
|
+
|
|
5
|
+
export const ExtraField =
|
|
6
|
+
Register.global("$hxEnums")["haxe.zip.ExtraField"] =
|
|
7
|
+
{
|
|
8
|
+
__ename__: "haxe.zip.ExtraField",
|
|
9
|
+
|
|
10
|
+
FUnknown: Object.assign((tag, bytes) => ({_hx_index: 0, __enum__: "haxe.zip.ExtraField", "tag": tag, "bytes": bytes}), {_hx_name: "FUnknown", __params__: ["tag", "bytes"]}),
|
|
11
|
+
FInfoZipUnicodePath: Object.assign((name, crc) => ({_hx_index: 1, __enum__: "haxe.zip.ExtraField", "name": name, "crc": crc}), {_hx_name: "FInfoZipUnicodePath", __params__: ["name", "crc"]}),
|
|
12
|
+
FUtf8: {_hx_name: "FUtf8", _hx_index: 2, __enum__: "haxe.zip.ExtraField"}
|
|
13
|
+
}
|
|
14
|
+
ExtraField.__constructs__ = [ExtraField.FUnknown, ExtraField.FInfoZipUnicodePath, ExtraField.FUtf8]
|
|
15
|
+
ExtraField.__empty_constructs__ = [ExtraField.FUtf8]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {Compress} from "./Compress.js"
|
|
2
|
+
import {Register} from "../../genes/Register.js"
|
|
3
|
+
|
|
4
|
+
const $global = Register.$global
|
|
5
|
+
|
|
6
|
+
export const Tools = Register.global("$hxClasses")["haxe.zip.Tools"] =
|
|
7
|
+
class Tools {
|
|
8
|
+
static compress(f, level) {
|
|
9
|
+
if (f.compressed) {
|
|
10
|
+
return;
|
|
11
|
+
};
|
|
12
|
+
var data = Compress.run(f.data, level);
|
|
13
|
+
f.compressed = true;
|
|
14
|
+
f.data = data.sub(2, data.length - 6);
|
|
15
|
+
f.dataSize = f.data.length;
|
|
16
|
+
}
|
|
17
|
+
static get __name__() {
|
|
18
|
+
return "haxe.zip.Tools"
|
|
19
|
+
}
|
|
20
|
+
get __class__() {
|
|
21
|
+
return Tools
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|