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,22 @@
|
|
|
1
|
+
import {Entry} from "./Entry"
|
|
2
|
+
import {Output} from "../io/Output"
|
|
3
|
+
import {Bytes} from "../io/Bytes"
|
|
4
|
+
import {List} from "../ds/List"
|
|
5
|
+
|
|
6
|
+
export declare class Writer {
|
|
7
|
+
constructor(o: Output)
|
|
8
|
+
protected o: Output
|
|
9
|
+
protected files: List<{
|
|
10
|
+
clen: number,
|
|
11
|
+
compressed: boolean,
|
|
12
|
+
crc: number,
|
|
13
|
+
date: Date,
|
|
14
|
+
fields: Bytes,
|
|
15
|
+
name: string,
|
|
16
|
+
size: number
|
|
17
|
+
}>
|
|
18
|
+
protected writeZipDate(date: Date): void
|
|
19
|
+
writeEntryHeader(f: Entry): void
|
|
20
|
+
write(files: List<Entry>): void
|
|
21
|
+
writeCDR(): void
|
|
22
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import {BytesOutput} from "../io/BytesOutput.js"
|
|
2
|
+
import {Bytes} from "../io/Bytes.js"
|
|
3
|
+
import {List} from "../ds/List.js"
|
|
4
|
+
import {Crc32} from "../crypto/Crc32.js"
|
|
5
|
+
import {Exception} from "../Exception.js"
|
|
6
|
+
import {Register} from "../../genes/Register.js"
|
|
7
|
+
|
|
8
|
+
const $global = Register.$global
|
|
9
|
+
|
|
10
|
+
export const Writer = Register.global("$hxClasses")["haxe.zip.Writer"] =
|
|
11
|
+
class Writer extends Register.inherits() {
|
|
12
|
+
new(o) {
|
|
13
|
+
this.o = o;
|
|
14
|
+
this.files = new List();
|
|
15
|
+
}
|
|
16
|
+
writeZipDate(date) {
|
|
17
|
+
this.o.writeUInt16(date.getHours() << 11 | date.getMinutes() << 5 | date.getSeconds() >> 1);
|
|
18
|
+
this.o.writeUInt16(date.getFullYear() - 1980 << 9 | date.getMonth() + 1 << 5 | date.getDate());
|
|
19
|
+
}
|
|
20
|
+
writeEntryHeader(f) {
|
|
21
|
+
var o = this.o;
|
|
22
|
+
var flags = 0;
|
|
23
|
+
if (f.extraFields != null) {
|
|
24
|
+
var _g_head = f.extraFields.h;
|
|
25
|
+
while (_g_head != null) {
|
|
26
|
+
var val = _g_head.item;
|
|
27
|
+
_g_head = _g_head.next;
|
|
28
|
+
if (val._hx_index == 2) {
|
|
29
|
+
flags |= 2048;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
o.writeInt32(67324752);
|
|
34
|
+
o.writeUInt16(20);
|
|
35
|
+
o.writeUInt16(flags);
|
|
36
|
+
if (f.data == null) {
|
|
37
|
+
f.fileSize = 0;
|
|
38
|
+
f.dataSize = 0;
|
|
39
|
+
f.crc32 = 0;
|
|
40
|
+
f.compressed = false;
|
|
41
|
+
f.data = new Bytes(new ArrayBuffer(0));
|
|
42
|
+
} else {
|
|
43
|
+
if (f.crc32 == null) {
|
|
44
|
+
if (f.compressed) {
|
|
45
|
+
throw Exception.thrown("CRC32 must be processed before compression");
|
|
46
|
+
};
|
|
47
|
+
f.crc32 = Crc32.make(f.data);
|
|
48
|
+
};
|
|
49
|
+
if (!f.compressed) {
|
|
50
|
+
f.fileSize = f.data.length;
|
|
51
|
+
};
|
|
52
|
+
f.dataSize = f.data.length;
|
|
53
|
+
};
|
|
54
|
+
o.writeUInt16((f.compressed) ? 8 : 0);
|
|
55
|
+
this.writeZipDate(f.fileTime);
|
|
56
|
+
o.writeInt32(f.crc32);
|
|
57
|
+
o.writeInt32(f.dataSize);
|
|
58
|
+
o.writeInt32(f.fileSize);
|
|
59
|
+
o.writeUInt16(f.fileName.length);
|
|
60
|
+
var e = new BytesOutput();
|
|
61
|
+
if (f.extraFields != null) {
|
|
62
|
+
var _g_head = f.extraFields.h;
|
|
63
|
+
while (_g_head != null) {
|
|
64
|
+
var val = _g_head.item;
|
|
65
|
+
_g_head = _g_head.next;
|
|
66
|
+
switch (val._hx_index) {
|
|
67
|
+
case 0:
|
|
68
|
+
var _g = val.bytes;
|
|
69
|
+
e.writeUInt16(val.tag);
|
|
70
|
+
e.writeUInt16(_g.length);
|
|
71
|
+
e.write(_g);
|
|
72
|
+
break
|
|
73
|
+
case 1:
|
|
74
|
+
var namebytes = Bytes.ofString(val.name);
|
|
75
|
+
e.writeUInt16(28789);
|
|
76
|
+
e.writeUInt16(namebytes.length + 5);
|
|
77
|
+
e.writeByte(1);
|
|
78
|
+
e.writeInt32(val.crc);
|
|
79
|
+
e.write(namebytes);
|
|
80
|
+
break
|
|
81
|
+
case 2:
|
|
82
|
+
break
|
|
83
|
+
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
var ebytes = e.getBytes();
|
|
88
|
+
o.writeUInt16(ebytes.length);
|
|
89
|
+
o.writeString(f.fileName);
|
|
90
|
+
o.write(ebytes);
|
|
91
|
+
this.files.add({"name": f.fileName, "compressed": f.compressed, "clen": f.data.length, "size": f.fileSize, "crc": f.crc32, "date": f.fileTime, "fields": ebytes});
|
|
92
|
+
}
|
|
93
|
+
write(files) {
|
|
94
|
+
var _g_head = files.h;
|
|
95
|
+
while (_g_head != null) {
|
|
96
|
+
var val = _g_head.item;
|
|
97
|
+
_g_head = _g_head.next;
|
|
98
|
+
this.writeEntryHeader(val);
|
|
99
|
+
this.o.writeFullBytes(val.data, 0, val.data.length);
|
|
100
|
+
};
|
|
101
|
+
this.writeCDR();
|
|
102
|
+
}
|
|
103
|
+
writeCDR() {
|
|
104
|
+
var cdr_size = 0;
|
|
105
|
+
var cdr_offset = 0;
|
|
106
|
+
var _g_head = this.files.h;
|
|
107
|
+
while (_g_head != null) {
|
|
108
|
+
var val = _g_head.item;
|
|
109
|
+
_g_head = _g_head.next;
|
|
110
|
+
var namelen = val.name.length;
|
|
111
|
+
var extraFieldsLength = val.fields.length;
|
|
112
|
+
this.o.writeInt32(33639248);
|
|
113
|
+
this.o.writeUInt16(20);
|
|
114
|
+
this.o.writeUInt16(20);
|
|
115
|
+
this.o.writeUInt16(0);
|
|
116
|
+
this.o.writeUInt16((val.compressed) ? 8 : 0);
|
|
117
|
+
this.writeZipDate(val.date);
|
|
118
|
+
this.o.writeInt32(val.crc);
|
|
119
|
+
this.o.writeInt32(val.clen);
|
|
120
|
+
this.o.writeInt32(val.size);
|
|
121
|
+
this.o.writeUInt16(namelen);
|
|
122
|
+
this.o.writeUInt16(extraFieldsLength);
|
|
123
|
+
this.o.writeUInt16(0);
|
|
124
|
+
this.o.writeUInt16(0);
|
|
125
|
+
this.o.writeUInt16(0);
|
|
126
|
+
this.o.writeInt32(0);
|
|
127
|
+
this.o.writeInt32(cdr_offset);
|
|
128
|
+
this.o.writeString(val.name);
|
|
129
|
+
this.o.write(val.fields);
|
|
130
|
+
cdr_size += 46 + namelen + extraFieldsLength;
|
|
131
|
+
cdr_offset += 30 + namelen + extraFieldsLength + val.clen;
|
|
132
|
+
};
|
|
133
|
+
this.o.writeInt32(101010256);
|
|
134
|
+
this.o.writeUInt16(0);
|
|
135
|
+
this.o.writeUInt16(0);
|
|
136
|
+
this.o.writeUInt16(this.files.length);
|
|
137
|
+
this.o.writeUInt16(this.files.length);
|
|
138
|
+
this.o.writeInt32(cdr_size);
|
|
139
|
+
this.o.writeInt32(cdr_offset);
|
|
140
|
+
this.o.writeUInt16(0);
|
|
141
|
+
}
|
|
142
|
+
static get __name__() {
|
|
143
|
+
return "haxe.zip.Writer"
|
|
144
|
+
}
|
|
145
|
+
get __class__() {
|
|
146
|
+
return Writer
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
package/bin/js/Boot.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
export declare class Boot {
|
|
3
|
+
protected static getClass(o: null | any): null | any
|
|
4
|
+
protected static __string_rec(o: {
|
|
5
|
+
__enum__: boolean,
|
|
6
|
+
_hx_index: number,
|
|
7
|
+
hasOwnProperty: (arg0: string) => boolean,
|
|
8
|
+
length: number,
|
|
9
|
+
toString: () => string
|
|
10
|
+
}, s: string): string
|
|
11
|
+
protected static __interfLoop(cc: any, cl: any): boolean
|
|
12
|
+
protected static __instanceof(o: any, cl: any): boolean
|
|
13
|
+
protected static __downcastCheck(o: any, cl: any): boolean
|
|
14
|
+
protected static __toStr: Function
|
|
15
|
+
protected static __nativeClassName(o: any): string
|
|
16
|
+
protected static __isNativeObj(o: any): boolean
|
|
17
|
+
protected static __resolveNativeClass(name: string): null | any
|
|
18
|
+
}
|
package/bin/js/Boot.js
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import {Register} from "../genes/Register.js"
|
|
2
|
+
|
|
3
|
+
const $global = Register.$global
|
|
4
|
+
|
|
5
|
+
export const Boot = Register.global("$hxClasses")["js.Boot"] =
|
|
6
|
+
class Boot {
|
|
7
|
+
static getClass(o) {
|
|
8
|
+
if (o == null) {
|
|
9
|
+
return null;
|
|
10
|
+
} else if (((o) instanceof Array)) {
|
|
11
|
+
return Array;
|
|
12
|
+
} else {
|
|
13
|
+
var cl = o.__class__;
|
|
14
|
+
if (cl != null) {
|
|
15
|
+
return cl;
|
|
16
|
+
};
|
|
17
|
+
var name = Boot.__nativeClassName(o);
|
|
18
|
+
if (name != null) {
|
|
19
|
+
return Boot.__resolveNativeClass(name);
|
|
20
|
+
};
|
|
21
|
+
return null;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
static __string_rec(o, s) {
|
|
25
|
+
if (o == null) {
|
|
26
|
+
return "null";
|
|
27
|
+
};
|
|
28
|
+
if (s.length >= 5) {
|
|
29
|
+
return "<...>";
|
|
30
|
+
};
|
|
31
|
+
var t = typeof(o);
|
|
32
|
+
if (t == "function" && (o.__name__ || o.__ename__)) {
|
|
33
|
+
t = "object";
|
|
34
|
+
};
|
|
35
|
+
switch (t) {
|
|
36
|
+
case "function":
|
|
37
|
+
return "<function>";
|
|
38
|
+
break
|
|
39
|
+
case "object":
|
|
40
|
+
if (o.__enum__) {
|
|
41
|
+
var e = Register.global("$hxEnums")[o.__enum__];
|
|
42
|
+
var con = e.__constructs__[o._hx_index];
|
|
43
|
+
var n = con._hx_name;
|
|
44
|
+
if (con.__params__) {
|
|
45
|
+
s = s + "\t";
|
|
46
|
+
return n + "(" + ((function($this) {var $r0
|
|
47
|
+
var _g = [];
|
|
48
|
+
{
|
|
49
|
+
var _g1 = 0;
|
|
50
|
+
var _g2 = con.__params__;
|
|
51
|
+
while (true) {
|
|
52
|
+
if (!(_g1 < _g2.length)) {
|
|
53
|
+
break;
|
|
54
|
+
};
|
|
55
|
+
var p = _g2[_g1];
|
|
56
|
+
_g1 = _g1 + 1;
|
|
57
|
+
_g.push(Boot.__string_rec(o[p], s));
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
$r0 = _g
|
|
62
|
+
return $r0})(this)).join(",") + ")";
|
|
63
|
+
} else {
|
|
64
|
+
return n;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
if (((o) instanceof Array)) {
|
|
68
|
+
var str = "[";
|
|
69
|
+
s += "\t";
|
|
70
|
+
var _g = 0;
|
|
71
|
+
var _g1 = o.length;
|
|
72
|
+
while (_g < _g1) {
|
|
73
|
+
var i = _g++;
|
|
74
|
+
str += ((i > 0) ? "," : "") + Boot.__string_rec(o[i], s);
|
|
75
|
+
};
|
|
76
|
+
str += "]";
|
|
77
|
+
return str;
|
|
78
|
+
};
|
|
79
|
+
var tostr;
|
|
80
|
+
try {
|
|
81
|
+
tostr = o.toString;
|
|
82
|
+
}catch (_g) {
|
|
83
|
+
return "???";
|
|
84
|
+
};
|
|
85
|
+
if (tostr != null && tostr != Object.toString && typeof(tostr) == "function") {
|
|
86
|
+
var s2 = o.toString();
|
|
87
|
+
if (s2 != "[object Object]") {
|
|
88
|
+
return s2;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
var str = "{\n";
|
|
92
|
+
s += "\t";
|
|
93
|
+
var hasp = o.hasOwnProperty != null;
|
|
94
|
+
var k = null;
|
|
95
|
+
for( k in o ) {;
|
|
96
|
+
if (hasp && !o.hasOwnProperty(k)) {
|
|
97
|
+
continue;
|
|
98
|
+
};
|
|
99
|
+
if (k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__") {
|
|
100
|
+
continue;
|
|
101
|
+
};
|
|
102
|
+
if (str.length != 2) {
|
|
103
|
+
str += ", \n";
|
|
104
|
+
};
|
|
105
|
+
str += s + k + " : " + Boot.__string_rec(o[k], s);
|
|
106
|
+
};
|
|
107
|
+
s = s.substring(1);
|
|
108
|
+
str += "\n" + s + "}";
|
|
109
|
+
return str;
|
|
110
|
+
break
|
|
111
|
+
case "string":
|
|
112
|
+
return o;
|
|
113
|
+
break
|
|
114
|
+
default:
|
|
115
|
+
return String(o);
|
|
116
|
+
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
static __interfLoop(cc, cl) {
|
|
120
|
+
while (true) {
|
|
121
|
+
if (cc == null) {
|
|
122
|
+
return false;
|
|
123
|
+
};
|
|
124
|
+
if (cc == cl) {
|
|
125
|
+
return true;
|
|
126
|
+
};
|
|
127
|
+
var intf = cc.__interfaces__;
|
|
128
|
+
if (intf != null) {
|
|
129
|
+
var _g = 0;
|
|
130
|
+
var _g1 = intf.length;
|
|
131
|
+
while (_g < _g1) {
|
|
132
|
+
var i = intf[_g++];
|
|
133
|
+
if (i == cl || Boot.__interfLoop(i, cl)) {
|
|
134
|
+
return true;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
cc = cc.__super__;
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
static __instanceof(o, cl) {
|
|
142
|
+
if (cl == null) {
|
|
143
|
+
return false;
|
|
144
|
+
};
|
|
145
|
+
switch (cl) {
|
|
146
|
+
case Array:
|
|
147
|
+
return ((o) instanceof Array);
|
|
148
|
+
break
|
|
149
|
+
case "$hxCoreType__Bool":
|
|
150
|
+
return typeof(o) == "boolean";
|
|
151
|
+
break
|
|
152
|
+
case "$hxCoreType__Dynamic":
|
|
153
|
+
return o != null;
|
|
154
|
+
break
|
|
155
|
+
case "$hxCoreType__Float":
|
|
156
|
+
return typeof(o) == "number";
|
|
157
|
+
break
|
|
158
|
+
case "$hxCoreType__Int":
|
|
159
|
+
if (typeof(o) == "number") {
|
|
160
|
+
return ((o | 0) === (o));
|
|
161
|
+
} else {
|
|
162
|
+
return false;
|
|
163
|
+
};
|
|
164
|
+
break
|
|
165
|
+
case String:
|
|
166
|
+
return typeof(o) == "string";
|
|
167
|
+
break
|
|
168
|
+
default:
|
|
169
|
+
if (o != null) {
|
|
170
|
+
if (typeof(cl) == "function") {
|
|
171
|
+
if (Boot.__downcastCheck(o, cl)) {
|
|
172
|
+
return true;
|
|
173
|
+
};
|
|
174
|
+
} else if (typeof(cl) == "object" && Boot.__isNativeObj(cl)) {
|
|
175
|
+
if (((o) instanceof cl)) {
|
|
176
|
+
return true;
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
} else {
|
|
180
|
+
return false;
|
|
181
|
+
};
|
|
182
|
+
if ((cl == "$hxCoreType__Class") ? o.__name__ != null : false) {
|
|
183
|
+
return true;
|
|
184
|
+
};
|
|
185
|
+
if ((cl == "$hxCoreType__Enum") ? o.__ename__ != null : false) {
|
|
186
|
+
return true;
|
|
187
|
+
};
|
|
188
|
+
return (o.__enum__ != null) ? Register.global("$hxEnums")[o.__enum__] == cl : false;
|
|
189
|
+
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
static __downcastCheck(o, cl) {
|
|
193
|
+
if (!((o) instanceof cl)) {
|
|
194
|
+
if (cl.__isInterface__) {
|
|
195
|
+
return Boot.__interfLoop(Boot.getClass(o), cl);
|
|
196
|
+
} else {
|
|
197
|
+
return false;
|
|
198
|
+
};
|
|
199
|
+
} else {
|
|
200
|
+
return true;
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
static __nativeClassName(o) {
|
|
204
|
+
var name = Boot.__toStr.call(o).slice(8, -1);
|
|
205
|
+
if (name == "Object" || name == "Function" || name == "Math" || name == "JSON") {
|
|
206
|
+
return null;
|
|
207
|
+
};
|
|
208
|
+
return name;
|
|
209
|
+
}
|
|
210
|
+
static __isNativeObj(o) {
|
|
211
|
+
return Boot.__nativeClassName(o) != null;
|
|
212
|
+
}
|
|
213
|
+
static __resolveNativeClass(name) {
|
|
214
|
+
return Register.$global[name];
|
|
215
|
+
}
|
|
216
|
+
static get __name__() {
|
|
217
|
+
return "js.Boot"
|
|
218
|
+
}
|
|
219
|
+
get __class__() {
|
|
220
|
+
return Boot
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
;Boot.__toStr = ({}).toString
|
package/bin/js/Node.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {Register} from "../../genes/Register.js"
|
|
2
|
+
|
|
3
|
+
const $global = Register.$global
|
|
4
|
+
|
|
5
|
+
export const ArrayBufferCompat = Register.global("$hxClasses")["js.lib._ArrayBuffer.ArrayBufferCompat"] =
|
|
6
|
+
class ArrayBufferCompat {
|
|
7
|
+
static sliceImpl(begin, end) {
|
|
8
|
+
var u = new Uint8Array(this, begin, (end == null) ? null : end - begin);
|
|
9
|
+
var resultArray = new Uint8Array(u.byteLength);
|
|
10
|
+
resultArray.set(u);
|
|
11
|
+
return resultArray.buffer;
|
|
12
|
+
}
|
|
13
|
+
static get __name__() {
|
|
14
|
+
return "js.lib._ArrayBuffer.ArrayBufferCompat"
|
|
15
|
+
}
|
|
16
|
+
get __class__() {
|
|
17
|
+
return ArrayBufferCompat
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
;if (ArrayBuffer.prototype.slice == null) {
|
|
23
|
+
ArrayBuffer.prototype.slice = ArrayBufferCompat.sliceImpl;
|
|
24
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
Native JavaScript iterator structure. To enable haxe for-in iteration, use `js.lib.HaxeIterator`, for example `for (v in new js.lib.HaxeIterator(jsIterator))` or add `using js.lib.HaxeIterator;` to your module
|
|
4
|
+
|
|
5
|
+
See [Iteration Protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols)
|
|
6
|
+
*/
|
|
7
|
+
export type Iterator<T> = {
|
|
8
|
+
next: () => IteratorStep<T>
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
Native JavaScript async iterator structure.
|
|
13
|
+
|
|
14
|
+
See [for await...of](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of)
|
|
15
|
+
*/
|
|
16
|
+
export type AsyncIterator<T> = {
|
|
17
|
+
next: () => Promise<IteratorStep<T>>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type IteratorStep<T> = {
|
|
21
|
+
done: boolean,
|
|
22
|
+
value?: null | T
|
|
23
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
Type for
|
|
4
|
+
@see <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object>
|
|
5
|
+
*/
|
|
6
|
+
export type ObjectPrototype = {
|
|
7
|
+
/**
|
|
8
|
+
Returns a boolean indicating whether an object contains the specified
|
|
9
|
+
property as a direct property of that object and not inherited through
|
|
10
|
+
the prototype chain.
|
|
11
|
+
*/
|
|
12
|
+
hasOwnProperty: Function,
|
|
13
|
+
/**
|
|
14
|
+
Returns a boolean indicating whether the object this method is called
|
|
15
|
+
upon is in the prototype chain of the specified object.
|
|
16
|
+
*/
|
|
17
|
+
isPrototypeOf: Function,
|
|
18
|
+
/**
|
|
19
|
+
Returns a boolean indicating if the internal enumerable attribute is set.
|
|
20
|
+
*/
|
|
21
|
+
propertyIsEnumerable: Function,
|
|
22
|
+
/**
|
|
23
|
+
Calls `toString()`.
|
|
24
|
+
*/
|
|
25
|
+
toLocaleString: Function,
|
|
26
|
+
/**
|
|
27
|
+
Returns a string representation of the object.
|
|
28
|
+
*/
|
|
29
|
+
toString: Function,
|
|
30
|
+
/**
|
|
31
|
+
Returns the primitive value of the specified object.
|
|
32
|
+
*/
|
|
33
|
+
valueOf: Function
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
@see <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty>
|
|
38
|
+
*/
|
|
39
|
+
export type ObjectPropertyDescriptor = {
|
|
40
|
+
/**
|
|
41
|
+
`true` if and only if the type of this property descriptor may be
|
|
42
|
+
changed and if the property may be deleted from the corresponding object.
|
|
43
|
+
|
|
44
|
+
Defaults to `false`.
|
|
45
|
+
*/
|
|
46
|
+
configurable?: null | boolean,
|
|
47
|
+
/**
|
|
48
|
+
`true` if and only if this property shows up during enumeration of the
|
|
49
|
+
properties on the corresponding object.
|
|
50
|
+
|
|
51
|
+
Defaults to `false`.
|
|
52
|
+
*/
|
|
53
|
+
enumerable?: null | boolean,
|
|
54
|
+
/**
|
|
55
|
+
A function which serves as a getter for the property, or `undefined` if
|
|
56
|
+
there is no getter. When the property is accessed, this function is
|
|
57
|
+
called without arguments and with `this` set to the object through which
|
|
58
|
+
the property is accessed (this may not be the object on which the
|
|
59
|
+
property is defined due to inheritance).
|
|
60
|
+
The return value will be used as the value of the property.
|
|
61
|
+
*/
|
|
62
|
+
get?: null | (() => any),
|
|
63
|
+
/**
|
|
64
|
+
A function which serves as a setter for the property, or undefined if
|
|
65
|
+
there is no setter. When the property is assigned to, this function
|
|
66
|
+
is called with one argument (the value being assigned to the property)
|
|
67
|
+
and with `this` set to the object through which the property is assigned.
|
|
68
|
+
*/
|
|
69
|
+
set?: null | ((arg0: any) => void),
|
|
70
|
+
/**
|
|
71
|
+
The value associated with the property.
|
|
72
|
+
Can be any valid JavaScript value (number, object, function, etc).
|
|
73
|
+
*/
|
|
74
|
+
value?: null | any,
|
|
75
|
+
/**
|
|
76
|
+
`true` if and only if the value associated with the property may be
|
|
77
|
+
changed with an assignment operator.
|
|
78
|
+
|
|
79
|
+
Defaults to `false`.
|
|
80
|
+
*/
|
|
81
|
+
writable?: null | boolean
|
|
82
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
export type ThenableStruct<T> = {
|
|
3
|
+
then: <TOut>(onFulfilled: null | ((arg0: T) => any), onRejected?: ((arg0: any) => any)) => ThenableStruct<TOut>
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export type PromiseSettleOutcome = {
|
|
7
|
+
reason?: null | any,
|
|
8
|
+
status: string,
|
|
9
|
+
value?: null | any
|
|
10
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
|
|
2
|
+
export type NumberFormatOptions = {
|
|
3
|
+
/**
|
|
4
|
+
The currency to use in currency formatting. Possible values are the ISO 4217 currency codes,
|
|
5
|
+
such as "USD" for the US dollar, "EUR" for the euro, or "CNY" for the Chinese RMB — see the
|
|
6
|
+
[Current currency & funds code list](https://www.currency-iso.org/en/home/tables/table-a1.html).
|
|
7
|
+
There is no default value; if the style is "currency", the currency property must be provided.
|
|
8
|
+
*/
|
|
9
|
+
currency?: null | string,
|
|
10
|
+
/**
|
|
11
|
+
How to display the currency in currency formatting.
|
|
12
|
+
The default is `Symbol`.
|
|
13
|
+
*/
|
|
14
|
+
currencyDisplay?: null | string,
|
|
15
|
+
/**
|
|
16
|
+
The locale matching algorithm to use.
|
|
17
|
+
The default is `BestFit`.
|
|
18
|
+
For information about this option, see the [Intl page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation).
|
|
19
|
+
*/
|
|
20
|
+
localeMatcher?: null | string,
|
|
21
|
+
/**
|
|
22
|
+
The maximum number of fraction digits to use.
|
|
23
|
+
Possible values are from 0 to 20; the default for plain number formatting is the larger of
|
|
24
|
+
minimumFractionDigits and 3; the default for currency formatting is the larger of minimumFractionDigits
|
|
25
|
+
and the number of minor unit digits provided by the [ISO 4217 currency code list](http://www.currency-iso.org/en/home/tables/table-a1.html)
|
|
26
|
+
(2 if the list doesn't provide that information); the default for percent formatting is the larger of
|
|
27
|
+
minimumFractionDigits and 0.
|
|
28
|
+
*/
|
|
29
|
+
maximumFractionDigits?: null | number,
|
|
30
|
+
/**
|
|
31
|
+
The maximum number of significant digits to use.
|
|
32
|
+
Possible values are from 1 to 21; the default is 21.
|
|
33
|
+
*/
|
|
34
|
+
maximumSignificantDigits?: null | number,
|
|
35
|
+
/**
|
|
36
|
+
The minimum number of fraction digits to use.
|
|
37
|
+
Possible values are from 0 to 20; the default for plain number and percent formatting is 0;
|
|
38
|
+
the default for currency formatting is the number of minor unit digits provided by the
|
|
39
|
+
[ISO 4217 currency code list](http://www.currency-iso.org/en/home/tables/table-a1.html)
|
|
40
|
+
(2 if the list doesn't provide that information).
|
|
41
|
+
*/
|
|
42
|
+
minimumFractionDigits?: null | number,
|
|
43
|
+
/**
|
|
44
|
+
The minimum number of integer digits to use.
|
|
45
|
+
Possible values are from 1 to 21; the default is 1.
|
|
46
|
+
*/
|
|
47
|
+
minimumIntegerDigits?: null | number,
|
|
48
|
+
/**
|
|
49
|
+
The minimum number of significant digits to use.
|
|
50
|
+
Possible values are from 1 to 21; the default is 1.
|
|
51
|
+
*/
|
|
52
|
+
minimumSignificantDigits?: null | number,
|
|
53
|
+
/**
|
|
54
|
+
The formatting style to use.
|
|
55
|
+
The default is `Decimal`.
|
|
56
|
+
*/
|
|
57
|
+
style?: null | string,
|
|
58
|
+
/**
|
|
59
|
+
Whether to use grouping separators, such as thousands separators or thousand/lakh/crore separators.
|
|
60
|
+
The default is `true`.
|
|
61
|
+
*/
|
|
62
|
+
useGrouping?: null | boolean
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export type NumberFormatResolvedOption = {
|
|
66
|
+
currency: string,
|
|
67
|
+
/**
|
|
68
|
+
The values provided for these properties in the `options` argument or filled in as defaults.
|
|
69
|
+
These properties are only present if `style` is `"currency"`.
|
|
70
|
+
*/
|
|
71
|
+
currencyDisplay: string,
|
|
72
|
+
/**
|
|
73
|
+
The BCP 47 language tag for the locale actually used. If any Unicode extension values were
|
|
74
|
+
requested in the input BCP 47 language tag that led to this locale, the key-value pairs that
|
|
75
|
+
were requested and are supported for this locale are included in `locale`.
|
|
76
|
+
*/
|
|
77
|
+
locale: string,
|
|
78
|
+
/**
|
|
79
|
+
The values provided for these properties in the `options` argument or filled in as defaults.
|
|
80
|
+
These properties are present only if neither m`inimumSignificantDigits` nor `maximumSignificantDigits`
|
|
81
|
+
was provided in the `options` argument.
|
|
82
|
+
*/
|
|
83
|
+
maximumFractionDigits: number,
|
|
84
|
+
/**
|
|
85
|
+
The values provided for these properties in the `options` argument or filled in as defaults.
|
|
86
|
+
These properties are present only if at least one of them was provided in the `options` argument.
|
|
87
|
+
*/
|
|
88
|
+
maximumSignificantDigits: number,
|
|
89
|
+
minimumFractionDigits: number,
|
|
90
|
+
minimumIntegerDigits: number,
|
|
91
|
+
minimumSignificantDigits: number,
|
|
92
|
+
/**
|
|
93
|
+
The value requested using the Unicode extension key `"nu"` or filled in as a default.
|
|
94
|
+
*/
|
|
95
|
+
numberingSystem: string,
|
|
96
|
+
style: string,
|
|
97
|
+
/**
|
|
98
|
+
The values provided for these properties in the `options` argument or filled in as defaults.
|
|
99
|
+
*/
|
|
100
|
+
useGrouping: string
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export type NumberFormatPart = {
|
|
104
|
+
type: string,
|
|
105
|
+
value: string
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export type NumberFormatSupportedLocalesOfOptions = {
|
|
109
|
+
/**
|
|
110
|
+
The locale matching algorithm to use.
|
|
111
|
+
The default is `BestFit`.
|
|
112
|
+
*/
|
|
113
|
+
localeMatcher?: null | string
|
|
114
|
+
}
|