@gadgetinc/substrate 0.1.0-rc.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/dist/assets/kernel.wasm +0 -0
- package/dist/assets/manifest.json +32 -0
- package/dist/assets/network-driver.js +2 -0
- package/dist/assets/network-driver.js.map +1 -0
- package/dist/assets/runtime.js +264 -0
- package/dist/assets/runtime.js.map +1 -0
- package/dist/binaries.d.ts +58 -0
- package/dist/binaries.d.ts.map +1 -0
- package/dist/boot/index.d.ts +318 -0
- package/dist/boot/index.d.ts.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4589 -0
- package/dist/index.js.map +1 -0
- package/dist/kernel/bridge.d.ts +64 -0
- package/dist/kernel/bridge.d.ts.map +1 -0
- package/dist/kernel/types.d.ts +518 -0
- package/dist/kernel/types.d.ts.map +1 -0
- package/dist/kernel/wasm.d.ts +20 -0
- package/dist/kernel/wasm.d.ts.map +1 -0
- package/dist/node/assert.d.ts +99 -0
- package/dist/node/assert.d.ts.map +1 -0
- package/dist/node/async_hooks.d.ts +88 -0
- package/dist/node/async_hooks.d.ts.map +1 -0
- package/dist/node/buffer.d.ts +62 -0
- package/dist/node/buffer.d.ts.map +1 -0
- package/dist/node/child_process.d.ts +300 -0
- package/dist/node/child_process.d.ts.map +1 -0
- package/dist/node/cluster.d.ts +37 -0
- package/dist/node/cluster.d.ts.map +1 -0
- package/dist/node/constants.d.ts +306 -0
- package/dist/node/constants.d.ts.map +1 -0
- package/dist/node/crypto.d.ts +176 -0
- package/dist/node/crypto.d.ts.map +1 -0
- package/dist/node/dgram.d.ts +44 -0
- package/dist/node/dgram.d.ts.map +1 -0
- package/dist/node/diagnostics_channel.d.ts +57 -0
- package/dist/node/diagnostics_channel.d.ts.map +1 -0
- package/dist/node/dns.d.ts +278 -0
- package/dist/node/dns.d.ts.map +1 -0
- package/dist/node/domain.d.ts +21 -0
- package/dist/node/domain.d.ts.map +1 -0
- package/dist/node/events.d.ts +54 -0
- package/dist/node/events.d.ts.map +1 -0
- package/dist/node/fs/promises.d.ts +116 -0
- package/dist/node/fs/promises.d.ts.map +1 -0
- package/dist/node/fs.d.ts +536 -0
- package/dist/node/fs.d.ts.map +1 -0
- package/dist/node/http.d.ts +471 -0
- package/dist/node/http.d.ts.map +1 -0
- package/dist/node/http2.d.ts +508 -0
- package/dist/node/http2.d.ts.map +1 -0
- package/dist/node/https.d.ts +42 -0
- package/dist/node/https.d.ts.map +1 -0
- package/dist/node/inspector.d.ts +25 -0
- package/dist/node/inspector.d.ts.map +1 -0
- package/dist/node/net.d.ts +231 -0
- package/dist/node/net.d.ts.map +1 -0
- package/dist/node/os.d.ts +318 -0
- package/dist/node/os.d.ts.map +1 -0
- package/dist/node/path.d.ts +144 -0
- package/dist/node/path.d.ts.map +1 -0
- package/dist/node/process.d.ts +105 -0
- package/dist/node/process.d.ts.map +1 -0
- package/dist/node/punycode.d.ts +34 -0
- package/dist/node/punycode.d.ts.map +1 -0
- package/dist/node/querystring.d.ts +49 -0
- package/dist/node/querystring.d.ts.map +1 -0
- package/dist/node/readline.d.ts +99 -0
- package/dist/node/readline.d.ts.map +1 -0
- package/dist/node/stream.d.ts +409 -0
- package/dist/node/stream.d.ts.map +1 -0
- package/dist/node/string_decoder.d.ts +46 -0
- package/dist/node/string_decoder.d.ts.map +1 -0
- package/dist/node/timers.d.ts +79 -0
- package/dist/node/timers.d.ts.map +1 -0
- package/dist/node/tls.d.ts +159 -0
- package/dist/node/tls.d.ts.map +1 -0
- package/dist/node/trace_events.d.ts +18 -0
- package/dist/node/trace_events.d.ts.map +1 -0
- package/dist/node/tty.d.ts +67 -0
- package/dist/node/tty.d.ts.map +1 -0
- package/dist/node/url.d.ts +85 -0
- package/dist/node/url.d.ts.map +1 -0
- package/dist/node/util.d.ts +252 -0
- package/dist/node/util.d.ts.map +1 -0
- package/dist/node/v8.d.ts +134 -0
- package/dist/node/v8.d.ts.map +1 -0
- package/dist/node/vm.d.ts +89 -0
- package/dist/node/vm.d.ts.map +1 -0
- package/dist/node/wasi.d.ts +25 -0
- package/dist/node/wasi.d.ts.map +1 -0
- package/dist/node/worker_threads.d.ts +206 -0
- package/dist/node/worker_threads.d.ts.map +1 -0
- package/dist/node/ws.d.ts +110 -0
- package/dist/node/ws.d.ts.map +1 -0
- package/dist/node/zlib.d.ts +328 -0
- package/dist/node/zlib.d.ts.map +1 -0
- package/dist/persistence/opfs-store.d.ts +93 -0
- package/dist/persistence/opfs-store.d.ts.map +1 -0
- package/dist/runtime/async-function-shim.d.ts +27 -0
- package/dist/runtime/async-function-shim.d.ts.map +1 -0
- package/dist/runtime/fs-interface.d.ts +60 -0
- package/dist/runtime/fs-interface.d.ts.map +1 -0
- package/dist/runtime/index.d.ts +113 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/loader.d.ts +50 -0
- package/dist/runtime/loader.d.ts.map +1 -0
- package/dist/runtime/loaders/async-transform.d.ts +40 -0
- package/dist/runtime/loaders/async-transform.d.ts.map +1 -0
- package/dist/runtime/loaders/cjs.d.ts +37 -0
- package/dist/runtime/loaders/cjs.d.ts.map +1 -0
- package/dist/runtime/loaders/detect-module-type.d.ts +21 -0
- package/dist/runtime/loaders/detect-module-type.d.ts.map +1 -0
- package/dist/runtime/loaders/esm.d.ts +140 -0
- package/dist/runtime/loaders/esm.d.ts.map +1 -0
- package/dist/runtime/loaders/source-map-registry.d.ts +43 -0
- package/dist/runtime/loaders/source-map-registry.d.ts.map +1 -0
- package/dist/runtime/loaders/source-map.d.ts +50 -0
- package/dist/runtime/loaders/source-map.d.ts.map +1 -0
- package/dist/runtime/loaders/utils.d.ts +6 -0
- package/dist/runtime/loaders/utils.d.ts.map +1 -0
- package/dist/runtime/native-globals.d.ts +24 -0
- package/dist/runtime/native-globals.d.ts.map +1 -0
- package/dist/runtime/network-driver.d.ts +78 -0
- package/dist/runtime/network-driver.d.ts.map +1 -0
- package/dist/runtime/process-context.d.ts +96 -0
- package/dist/runtime/process-context.d.ts.map +1 -0
- package/dist/runtime/process-event-loop.d.ts +356 -0
- package/dist/runtime/process-event-loop.d.ts.map +1 -0
- package/dist/runtime/process-handler.d.ts +71 -0
- package/dist/runtime/process-handler.d.ts.map +1 -0
- package/dist/runtime/process-handlers/node.d.ts +22 -0
- package/dist/runtime/process-handlers/node.d.ts.map +1 -0
- package/dist/runtime/process-handlers/npm.d.ts +20 -0
- package/dist/runtime/process-handlers/npm.d.ts.map +1 -0
- package/dist/runtime/process-handlers/npx.d.ts +11 -0
- package/dist/runtime/process-handlers/npx.d.ts.map +1 -0
- package/dist/runtime/process-handlers/pnpm.d.ts +12 -0
- package/dist/runtime/process-handlers/pnpm.d.ts.map +1 -0
- package/dist/runtime/process-handlers/shell.d.ts +24 -0
- package/dist/runtime/process-handlers/shell.d.ts.map +1 -0
- package/dist/runtime/process-handlers/yarn.d.ts +12 -0
- package/dist/runtime/process-handlers/yarn.d.ts.map +1 -0
- package/dist/runtime/process-helpers.d.ts +17 -0
- package/dist/runtime/process-helpers.d.ts.map +1 -0
- package/dist/runtime/process-manager.d.ts +87 -0
- package/dist/runtime/process-manager.d.ts.map +1 -0
- package/dist/runtime/process-scheduler.d.ts +123 -0
- package/dist/runtime/process-scheduler.d.ts.map +1 -0
- package/dist/runtime/process-waker.d.ts +24 -0
- package/dist/runtime/process-waker.d.ts.map +1 -0
- package/dist/runtime/promise.d.ts +44 -0
- package/dist/runtime/promise.d.ts.map +1 -0
- package/dist/runtime/stack-trace.d.ts +52 -0
- package/dist/runtime/stack-trace.d.ts.map +1 -0
- package/dist/runtime/wasm-package-interceptor.d.ts +141 -0
- package/dist/runtime/wasm-package-interceptor.d.ts.map +1 -0
- package/dist/runtime/web-streams.d.ts +57 -0
- package/dist/runtime/web-streams.d.ts.map +1 -0
- package/dist/runtime/websocket.d.ts +102 -0
- package/dist/runtime/websocket.d.ts.map +1 -0
- package/dist/shim/websocket-shim-inline.d.ts +9 -0
- package/dist/shim/websocket-shim-inline.d.ts.map +1 -0
- package/dist/shim/websocket-shim.d.ts +15 -0
- package/dist/shim/websocket-shim.d.ts.map +1 -0
- package/dist/sw/index.d.ts +53 -0
- package/dist/sw/index.d.ts.map +1 -0
- package/dist/utils/debug.d.ts +75 -0
- package/dist/utils/debug.d.ts.map +1 -0
- package/dist/utils/path.d.ts +20 -0
- package/dist/utils/path.d.ts.map +1 -0
- package/dist/utils/tarball.d.ts +37 -0
- package/dist/utils/tarball.d.ts.map +1 -0
- package/dist/utils/websocket-protocol.d.ts +102 -0
- package/dist/utils/websocket-protocol.d.ts.map +1 -0
- package/dist/worker/host.d.ts +14 -0
- package/dist/worker/host.d.ts.map +1 -0
- package/dist/worker/types.d.ts +209 -0
- package/dist/worker/types.d.ts.map +1 -0
- package/package.json +53 -0
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js constants module
|
|
3
|
+
*
|
|
4
|
+
* This module exports OS-level constants. In Substrate, we provide
|
|
5
|
+
* a subset that's commonly used by npm packages.
|
|
6
|
+
*/
|
|
7
|
+
export declare const O_RDONLY = 0;
|
|
8
|
+
export declare const O_WRONLY = 1;
|
|
9
|
+
export declare const O_RDWR = 2;
|
|
10
|
+
export declare const O_CREAT = 64;
|
|
11
|
+
export declare const O_EXCL = 128;
|
|
12
|
+
export declare const O_NOCTTY = 256;
|
|
13
|
+
export declare const O_TRUNC = 512;
|
|
14
|
+
export declare const O_APPEND = 1024;
|
|
15
|
+
export declare const O_NONBLOCK = 2048;
|
|
16
|
+
export declare const O_DSYNC = 4096;
|
|
17
|
+
export declare const O_DIRECTORY = 65536;
|
|
18
|
+
export declare const O_NOFOLLOW = 131072;
|
|
19
|
+
export declare const O_NOATIME = 262144;
|
|
20
|
+
export declare const O_SYNC = 1052672;
|
|
21
|
+
export declare const O_SYMLINK = 2097152;
|
|
22
|
+
export declare const S_IFMT = 61440;
|
|
23
|
+
export declare const S_IFREG = 32768;
|
|
24
|
+
export declare const S_IFDIR = 16384;
|
|
25
|
+
export declare const S_IFCHR = 8192;
|
|
26
|
+
export declare const S_IFBLK = 24576;
|
|
27
|
+
export declare const S_IFIFO = 4096;
|
|
28
|
+
export declare const S_IFLNK = 40960;
|
|
29
|
+
export declare const S_IFSOCK = 49152;
|
|
30
|
+
export declare const S_IRWXU = 448;
|
|
31
|
+
export declare const S_IRUSR = 256;
|
|
32
|
+
export declare const S_IWUSR = 128;
|
|
33
|
+
export declare const S_IXUSR = 64;
|
|
34
|
+
export declare const S_IRWXG = 56;
|
|
35
|
+
export declare const S_IRGRP = 32;
|
|
36
|
+
export declare const S_IWGRP = 16;
|
|
37
|
+
export declare const S_IXGRP = 8;
|
|
38
|
+
export declare const S_IRWXO = 7;
|
|
39
|
+
export declare const S_IROTH = 4;
|
|
40
|
+
export declare const S_IWOTH = 2;
|
|
41
|
+
export declare const S_IXOTH = 1;
|
|
42
|
+
export declare const E2BIG = 7;
|
|
43
|
+
export declare const EACCES = 13;
|
|
44
|
+
export declare const EADDRINUSE = 98;
|
|
45
|
+
export declare const EADDRNOTAVAIL = 99;
|
|
46
|
+
export declare const EAFNOSUPPORT = 97;
|
|
47
|
+
export declare const EAGAIN = 11;
|
|
48
|
+
export declare const EALREADY = 114;
|
|
49
|
+
export declare const EBADF = 9;
|
|
50
|
+
export declare const EBADMSG = 74;
|
|
51
|
+
export declare const EBUSY = 16;
|
|
52
|
+
export declare const ECANCELED = 125;
|
|
53
|
+
export declare const ECHILD = 10;
|
|
54
|
+
export declare const ECONNABORTED = 103;
|
|
55
|
+
export declare const ECONNREFUSED = 111;
|
|
56
|
+
export declare const ECONNRESET = 104;
|
|
57
|
+
export declare const EDEADLK = 35;
|
|
58
|
+
export declare const EDESTADDRREQ = 89;
|
|
59
|
+
export declare const EDOM = 33;
|
|
60
|
+
export declare const EDQUOT = 122;
|
|
61
|
+
export declare const EEXIST = 17;
|
|
62
|
+
export declare const EFAULT = 14;
|
|
63
|
+
export declare const EFBIG = 27;
|
|
64
|
+
export declare const EHOSTUNREACH = 113;
|
|
65
|
+
export declare const EIDRM = 43;
|
|
66
|
+
export declare const EILSEQ = 84;
|
|
67
|
+
export declare const EINPROGRESS = 115;
|
|
68
|
+
export declare const EINTR = 4;
|
|
69
|
+
export declare const EINVAL = 22;
|
|
70
|
+
export declare const EIO = 5;
|
|
71
|
+
export declare const EISCONN = 106;
|
|
72
|
+
export declare const EISDIR = 21;
|
|
73
|
+
export declare const ELOOP = 40;
|
|
74
|
+
export declare const EMFILE = 24;
|
|
75
|
+
export declare const EMLINK = 31;
|
|
76
|
+
export declare const EMSGSIZE = 90;
|
|
77
|
+
export declare const EMULTIHOP = 72;
|
|
78
|
+
export declare const ENAMETOOLONG = 36;
|
|
79
|
+
export declare const ENETDOWN = 100;
|
|
80
|
+
export declare const ENETRESET = 102;
|
|
81
|
+
export declare const ENETUNREACH = 101;
|
|
82
|
+
export declare const ENFILE = 23;
|
|
83
|
+
export declare const ENOBUFS = 105;
|
|
84
|
+
export declare const ENODATA = 61;
|
|
85
|
+
export declare const ENODEV = 19;
|
|
86
|
+
export declare const ENOENT = 2;
|
|
87
|
+
export declare const ENOEXEC = 8;
|
|
88
|
+
export declare const ENOLCK = 37;
|
|
89
|
+
export declare const ENOLINK = 67;
|
|
90
|
+
export declare const ENOMEM = 12;
|
|
91
|
+
export declare const ENOMSG = 42;
|
|
92
|
+
export declare const ENOPROTOOPT = 92;
|
|
93
|
+
export declare const ENOSPC = 28;
|
|
94
|
+
export declare const ENOSR = 63;
|
|
95
|
+
export declare const ENOSTR = 60;
|
|
96
|
+
export declare const ENOSYS = 38;
|
|
97
|
+
export declare const ENOTCONN = 107;
|
|
98
|
+
export declare const ENOTDIR = 20;
|
|
99
|
+
export declare const ENOTEMPTY = 39;
|
|
100
|
+
export declare const ENOTSOCK = 88;
|
|
101
|
+
export declare const ENOTSUP = 95;
|
|
102
|
+
export declare const ENOTTY = 25;
|
|
103
|
+
export declare const ENXIO = 6;
|
|
104
|
+
export declare const EOPNOTSUPP = 95;
|
|
105
|
+
export declare const EOVERFLOW = 75;
|
|
106
|
+
export declare const EPERM = 1;
|
|
107
|
+
export declare const EPIPE = 32;
|
|
108
|
+
export declare const EPROTO = 71;
|
|
109
|
+
export declare const EPROTONOSUPPORT = 93;
|
|
110
|
+
export declare const EPROTOTYPE = 91;
|
|
111
|
+
export declare const ERANGE = 34;
|
|
112
|
+
export declare const EROFS = 30;
|
|
113
|
+
export declare const ESPIPE = 29;
|
|
114
|
+
export declare const ESRCH = 3;
|
|
115
|
+
export declare const ESTALE = 116;
|
|
116
|
+
export declare const ETIME = 62;
|
|
117
|
+
export declare const ETIMEDOUT = 110;
|
|
118
|
+
export declare const ETXTBSY = 26;
|
|
119
|
+
export declare const EWOULDBLOCK = 11;
|
|
120
|
+
export declare const EXDEV = 18;
|
|
121
|
+
export declare const SIGHUP = 1;
|
|
122
|
+
export declare const SIGINT = 2;
|
|
123
|
+
export declare const SIGQUIT = 3;
|
|
124
|
+
export declare const SIGILL = 4;
|
|
125
|
+
export declare const SIGTRAP = 5;
|
|
126
|
+
export declare const SIGABRT = 6;
|
|
127
|
+
export declare const SIGIOT = 6;
|
|
128
|
+
export declare const SIGBUS = 7;
|
|
129
|
+
export declare const SIGFPE = 8;
|
|
130
|
+
export declare const SIGKILL = 9;
|
|
131
|
+
export declare const SIGUSR1 = 10;
|
|
132
|
+
export declare const SIGSEGV = 11;
|
|
133
|
+
export declare const SIGUSR2 = 12;
|
|
134
|
+
export declare const SIGPIPE = 13;
|
|
135
|
+
export declare const SIGALRM = 14;
|
|
136
|
+
export declare const SIGTERM = 15;
|
|
137
|
+
export declare const SIGCHLD = 17;
|
|
138
|
+
export declare const SIGCONT = 18;
|
|
139
|
+
export declare const SIGSTOP = 19;
|
|
140
|
+
export declare const SIGTSTP = 20;
|
|
141
|
+
export declare const SIGTTIN = 21;
|
|
142
|
+
export declare const SIGTTOU = 22;
|
|
143
|
+
export declare const SIGURG = 23;
|
|
144
|
+
export declare const SIGXCPU = 24;
|
|
145
|
+
export declare const SIGXFSZ = 25;
|
|
146
|
+
export declare const SIGVTALRM = 26;
|
|
147
|
+
export declare const SIGPROF = 27;
|
|
148
|
+
export declare const SIGWINCH = 28;
|
|
149
|
+
export declare const SIGIO = 29;
|
|
150
|
+
export declare const SIGPOLL = 29;
|
|
151
|
+
export declare const SIGPWR = 30;
|
|
152
|
+
export declare const SIGSYS = 31;
|
|
153
|
+
/**
|
|
154
|
+
* Convert numeric open flags to the string form the kernel expects.
|
|
155
|
+
*/
|
|
156
|
+
export declare function flagsNumberToString(flags: number): string;
|
|
157
|
+
declare const _default: {
|
|
158
|
+
O_RDONLY: number;
|
|
159
|
+
O_WRONLY: number;
|
|
160
|
+
O_RDWR: number;
|
|
161
|
+
O_CREAT: number;
|
|
162
|
+
O_EXCL: number;
|
|
163
|
+
O_NOCTTY: number;
|
|
164
|
+
O_TRUNC: number;
|
|
165
|
+
O_APPEND: number;
|
|
166
|
+
O_DIRECTORY: number;
|
|
167
|
+
O_NOATIME: number;
|
|
168
|
+
O_NOFOLLOW: number;
|
|
169
|
+
O_SYNC: number;
|
|
170
|
+
O_DSYNC: number;
|
|
171
|
+
O_SYMLINK: number;
|
|
172
|
+
O_NONBLOCK: number;
|
|
173
|
+
S_IFMT: number;
|
|
174
|
+
S_IFREG: number;
|
|
175
|
+
S_IFDIR: number;
|
|
176
|
+
S_IFCHR: number;
|
|
177
|
+
S_IFBLK: number;
|
|
178
|
+
S_IFIFO: number;
|
|
179
|
+
S_IFLNK: number;
|
|
180
|
+
S_IFSOCK: number;
|
|
181
|
+
S_IRWXU: number;
|
|
182
|
+
S_IRUSR: number;
|
|
183
|
+
S_IWUSR: number;
|
|
184
|
+
S_IXUSR: number;
|
|
185
|
+
S_IRWXG: number;
|
|
186
|
+
S_IRGRP: number;
|
|
187
|
+
S_IWGRP: number;
|
|
188
|
+
S_IXGRP: number;
|
|
189
|
+
S_IRWXO: number;
|
|
190
|
+
S_IROTH: number;
|
|
191
|
+
S_IWOTH: number;
|
|
192
|
+
S_IXOTH: number;
|
|
193
|
+
E2BIG: number;
|
|
194
|
+
EACCES: number;
|
|
195
|
+
EADDRINUSE: number;
|
|
196
|
+
EADDRNOTAVAIL: number;
|
|
197
|
+
EAFNOSUPPORT: number;
|
|
198
|
+
EAGAIN: number;
|
|
199
|
+
EALREADY: number;
|
|
200
|
+
EBADF: number;
|
|
201
|
+
EBADMSG: number;
|
|
202
|
+
EBUSY: number;
|
|
203
|
+
ECANCELED: number;
|
|
204
|
+
ECHILD: number;
|
|
205
|
+
ECONNABORTED: number;
|
|
206
|
+
ECONNREFUSED: number;
|
|
207
|
+
ECONNRESET: number;
|
|
208
|
+
EDEADLK: number;
|
|
209
|
+
EDESTADDRREQ: number;
|
|
210
|
+
EDOM: number;
|
|
211
|
+
EDQUOT: number;
|
|
212
|
+
EEXIST: number;
|
|
213
|
+
EFAULT: number;
|
|
214
|
+
EFBIG: number;
|
|
215
|
+
EHOSTUNREACH: number;
|
|
216
|
+
EIDRM: number;
|
|
217
|
+
EILSEQ: number;
|
|
218
|
+
EINPROGRESS: number;
|
|
219
|
+
EINTR: number;
|
|
220
|
+
EINVAL: number;
|
|
221
|
+
EIO: number;
|
|
222
|
+
EISCONN: number;
|
|
223
|
+
EISDIR: number;
|
|
224
|
+
ELOOP: number;
|
|
225
|
+
EMFILE: number;
|
|
226
|
+
EMLINK: number;
|
|
227
|
+
EMSGSIZE: number;
|
|
228
|
+
EMULTIHOP: number;
|
|
229
|
+
ENAMETOOLONG: number;
|
|
230
|
+
ENETDOWN: number;
|
|
231
|
+
ENETRESET: number;
|
|
232
|
+
ENETUNREACH: number;
|
|
233
|
+
ENFILE: number;
|
|
234
|
+
ENOBUFS: number;
|
|
235
|
+
ENODATA: number;
|
|
236
|
+
ENODEV: number;
|
|
237
|
+
ENOENT: number;
|
|
238
|
+
ENOEXEC: number;
|
|
239
|
+
ENOLCK: number;
|
|
240
|
+
ENOLINK: number;
|
|
241
|
+
ENOMEM: number;
|
|
242
|
+
ENOMSG: number;
|
|
243
|
+
ENOPROTOOPT: number;
|
|
244
|
+
ENOSPC: number;
|
|
245
|
+
ENOSR: number;
|
|
246
|
+
ENOSTR: number;
|
|
247
|
+
ENOSYS: number;
|
|
248
|
+
ENOTCONN: number;
|
|
249
|
+
ENOTDIR: number;
|
|
250
|
+
ENOTEMPTY: number;
|
|
251
|
+
ENOTSOCK: number;
|
|
252
|
+
ENOTSUP: number;
|
|
253
|
+
ENOTTY: number;
|
|
254
|
+
ENXIO: number;
|
|
255
|
+
EOPNOTSUPP: number;
|
|
256
|
+
EOVERFLOW: number;
|
|
257
|
+
EPERM: number;
|
|
258
|
+
EPIPE: number;
|
|
259
|
+
EPROTO: number;
|
|
260
|
+
EPROTONOSUPPORT: number;
|
|
261
|
+
EPROTOTYPE: number;
|
|
262
|
+
ERANGE: number;
|
|
263
|
+
EROFS: number;
|
|
264
|
+
ESPIPE: number;
|
|
265
|
+
ESRCH: number;
|
|
266
|
+
ESTALE: number;
|
|
267
|
+
ETIME: number;
|
|
268
|
+
ETIMEDOUT: number;
|
|
269
|
+
ETXTBSY: number;
|
|
270
|
+
EWOULDBLOCK: number;
|
|
271
|
+
EXDEV: number;
|
|
272
|
+
SIGHUP: number;
|
|
273
|
+
SIGINT: number;
|
|
274
|
+
SIGQUIT: number;
|
|
275
|
+
SIGILL: number;
|
|
276
|
+
SIGTRAP: number;
|
|
277
|
+
SIGABRT: number;
|
|
278
|
+
SIGIOT: number;
|
|
279
|
+
SIGBUS: number;
|
|
280
|
+
SIGFPE: number;
|
|
281
|
+
SIGKILL: number;
|
|
282
|
+
SIGUSR1: number;
|
|
283
|
+
SIGSEGV: number;
|
|
284
|
+
SIGUSR2: number;
|
|
285
|
+
SIGPIPE: number;
|
|
286
|
+
SIGALRM: number;
|
|
287
|
+
SIGTERM: number;
|
|
288
|
+
SIGCHLD: number;
|
|
289
|
+
SIGCONT: number;
|
|
290
|
+
SIGSTOP: number;
|
|
291
|
+
SIGTSTP: number;
|
|
292
|
+
SIGTTIN: number;
|
|
293
|
+
SIGTTOU: number;
|
|
294
|
+
SIGURG: number;
|
|
295
|
+
SIGXCPU: number;
|
|
296
|
+
SIGXFSZ: number;
|
|
297
|
+
SIGVTALRM: number;
|
|
298
|
+
SIGPROF: number;
|
|
299
|
+
SIGWINCH: number;
|
|
300
|
+
SIGIO: number;
|
|
301
|
+
SIGPOLL: number;
|
|
302
|
+
SIGPWR: number;
|
|
303
|
+
SIGSYS: number;
|
|
304
|
+
};
|
|
305
|
+
export default _default;
|
|
306
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/node/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,eAAO,MAAM,QAAQ,IAAI,CAAC;AAC1B,eAAO,MAAM,QAAQ,IAAI,CAAC;AAC1B,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,OAAO,KAAK,CAAC;AAC1B,eAAO,MAAM,MAAM,MAAM,CAAC;AAC1B,eAAO,MAAM,QAAQ,MAAM,CAAC;AAC5B,eAAO,MAAM,OAAO,MAAM,CAAC;AAC3B,eAAO,MAAM,QAAQ,OAAO,CAAC;AAC7B,eAAO,MAAM,UAAU,OAAO,CAAC;AAC/B,eAAO,MAAM,OAAO,OAAO,CAAC;AAC5B,eAAO,MAAM,WAAW,QAAQ,CAAC;AACjC,eAAO,MAAM,UAAU,SAAS,CAAC;AACjC,eAAO,MAAM,SAAS,SAAS,CAAC;AAChC,eAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,eAAO,MAAM,SAAS,UAAU,CAAC;AAGjC,eAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,eAAO,MAAM,OAAO,QAAQ,CAAC;AAC7B,eAAO,MAAM,OAAO,QAAQ,CAAC;AAC7B,eAAO,MAAM,OAAO,OAAO,CAAC;AAC5B,eAAO,MAAM,OAAO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|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js crypto module compatibility layer
|
|
3
|
+
*
|
|
4
|
+
* This module provides the Node.js crypto API using:
|
|
5
|
+
* - @noble/hashes for synchronous hashing (SHA-1, SHA-256, etc.)
|
|
6
|
+
* - Web Crypto API for random number generation
|
|
7
|
+
*
|
|
8
|
+
* @see https://nodejs.org/api/crypto.html
|
|
9
|
+
*/
|
|
10
|
+
import { Buffer } from "./buffer.js";
|
|
11
|
+
type Encoding = "hex" | "base64" | "base64url" | "latin1" | "binary";
|
|
12
|
+
type BinaryLike = string | Buffer | Uint8Array | ArrayBuffer | DataView;
|
|
13
|
+
export interface Hash {
|
|
14
|
+
/**
|
|
15
|
+
* Update the hash with data
|
|
16
|
+
*/
|
|
17
|
+
update(data: BinaryLike, inputEncoding?: BufferEncoding): Hash;
|
|
18
|
+
/**
|
|
19
|
+
* Compute the digest (synchronous, matching Node.js API)
|
|
20
|
+
*/
|
|
21
|
+
digest(encoding?: Encoding): Buffer | string;
|
|
22
|
+
/**
|
|
23
|
+
* Copy the hash state
|
|
24
|
+
*/
|
|
25
|
+
copy(): Hash;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* One-shot hash function (Node.js 21+).
|
|
29
|
+
* Computes a hash of the data in a single call.
|
|
30
|
+
*
|
|
31
|
+
* @param algorithm - The hash algorithm (md5, sha1, sha256, sha384, sha512, sha3-256, sha3-384, sha3-512)
|
|
32
|
+
* @param data - The data to hash
|
|
33
|
+
* @param outputEncoding - Optional output encoding (hex, base64, etc.)
|
|
34
|
+
* @returns Hash as Buffer or string depending on outputEncoding
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const digest = crypto.hash('sha256', 'hello', 'hex');
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function hash(algorithm: string, data: BinaryLike, outputEncoding?: Encoding): Buffer | string;
|
|
42
|
+
/**
|
|
43
|
+
* Creates and returns a Hash object.
|
|
44
|
+
*
|
|
45
|
+
* @param algorithm - The hash algorithm (md5, sha1, sha256, sha384, sha512, sha3-256, sha3-384, sha3-512)
|
|
46
|
+
* @returns Hash object
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const hash = crypto.createHash('sha256');
|
|
51
|
+
* hash.update('hello');
|
|
52
|
+
* const digest = hash.digest('hex');
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function createHash(algorithm: string): Hash;
|
|
56
|
+
export interface Hmac {
|
|
57
|
+
/**
|
|
58
|
+
* Update the HMAC with data
|
|
59
|
+
*/
|
|
60
|
+
update(data: BinaryLike, inputEncoding?: BufferEncoding): Hmac;
|
|
61
|
+
/**
|
|
62
|
+
* Compute the HMAC digest (synchronous, matching Node.js API)
|
|
63
|
+
*/
|
|
64
|
+
digest(encoding?: Encoding): Buffer | string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Creates and returns an Hmac object.
|
|
68
|
+
*
|
|
69
|
+
* @param algorithm - The HMAC algorithm (sha1, sha256, sha384, sha512)
|
|
70
|
+
* @param key - The secret key
|
|
71
|
+
* @returns Hmac object
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* const hmacObj = crypto.createHmac('sha256', 'secret');
|
|
76
|
+
* hmacObj.update('hello');
|
|
77
|
+
* const digest = hmacObj.digest('hex');
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare function createHmac(algorithm: string, key: BinaryLike): Hmac;
|
|
81
|
+
/**
|
|
82
|
+
* Generates cryptographically strong pseudorandom data.
|
|
83
|
+
*
|
|
84
|
+
* @param size - Number of bytes to generate
|
|
85
|
+
* @returns Buffer containing random bytes
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* const buf = crypto.randomBytes(16);
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export declare function randomBytes(size: number): Buffer;
|
|
93
|
+
export declare function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
|
|
94
|
+
/**
|
|
95
|
+
* Synchronous version of randomBytes.
|
|
96
|
+
*/
|
|
97
|
+
export declare function randomBytesSync(size: number): Buffer;
|
|
98
|
+
/**
|
|
99
|
+
* Generates a random RFC 4122 version 4 UUID.
|
|
100
|
+
*
|
|
101
|
+
* @returns UUID string
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* const uuid = crypto.randomUUID();
|
|
106
|
+
* // '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
export declare function randomUUID(): string;
|
|
110
|
+
/**
|
|
111
|
+
* Fill a buffer with random data.
|
|
112
|
+
*
|
|
113
|
+
* @param buffer - Buffer to fill
|
|
114
|
+
* @param offset - Starting offset (default: 0)
|
|
115
|
+
* @param size - Number of bytes to fill (default: buffer.length - offset)
|
|
116
|
+
* @returns The filled buffer
|
|
117
|
+
*/
|
|
118
|
+
export declare function randomFillSync(buffer: Buffer | Uint8Array, offset?: number, size?: number): Buffer | Uint8Array;
|
|
119
|
+
/**
|
|
120
|
+
* Async version of randomFill.
|
|
121
|
+
*/
|
|
122
|
+
export declare function randomFill(buffer: Buffer | Uint8Array, callback: (err: Error | null, buf: Buffer | Uint8Array) => void): void;
|
|
123
|
+
export declare function randomFill(buffer: Buffer | Uint8Array, offset: number, callback: (err: Error | null, buf: Buffer | Uint8Array) => void): void;
|
|
124
|
+
export declare function randomFill(buffer: Buffer | Uint8Array, offset: number, size: number, callback: (err: Error | null, buf: Buffer | Uint8Array) => void): void;
|
|
125
|
+
/**
|
|
126
|
+
* Generate a random integer in the range [min, max).
|
|
127
|
+
*/
|
|
128
|
+
export declare function randomInt(max: number): number;
|
|
129
|
+
export declare function randomInt(min: number, max: number): number;
|
|
130
|
+
export declare function randomInt(max: number, callback: (err: Error | null, value: number) => void): void;
|
|
131
|
+
export declare function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void;
|
|
132
|
+
/**
|
|
133
|
+
* Get list of supported hash algorithms
|
|
134
|
+
*/
|
|
135
|
+
export declare function getHashes(): string[];
|
|
136
|
+
/**
|
|
137
|
+
* Get list of supported cipher algorithms
|
|
138
|
+
*/
|
|
139
|
+
export declare function getCiphers(): string[];
|
|
140
|
+
/**
|
|
141
|
+
* Check if timing-safe equal
|
|
142
|
+
*/
|
|
143
|
+
export declare function timingSafeEqual(a: Buffer | Uint8Array, b: Buffer | Uint8Array): boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Fill a typed array with cryptographically secure random values.
|
|
146
|
+
* This is a pass-through to the Web Crypto API's getRandomValues.
|
|
147
|
+
*
|
|
148
|
+
* @param typedArray - A typed array to fill with random values
|
|
149
|
+
* @returns The same typed array filled with random values
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```ts
|
|
153
|
+
* const array = new Uint8Array(16);
|
|
154
|
+
* crypto.getRandomValues(array);
|
|
155
|
+
* ```
|
|
156
|
+
*/
|
|
157
|
+
export declare function getRandomValues<T extends ArrayBufferView | null>(typedArray: T): T;
|
|
158
|
+
export declare const webcrypto: Crypto;
|
|
159
|
+
declare const _default: {
|
|
160
|
+
hash: typeof hash;
|
|
161
|
+
createHash: typeof createHash;
|
|
162
|
+
createHmac: typeof createHmac;
|
|
163
|
+
randomBytes: typeof randomBytes;
|
|
164
|
+
randomBytesSync: typeof randomBytesSync;
|
|
165
|
+
randomUUID: typeof randomUUID;
|
|
166
|
+
randomFillSync: typeof randomFillSync;
|
|
167
|
+
randomFill: typeof randomFill;
|
|
168
|
+
randomInt: typeof randomInt;
|
|
169
|
+
getRandomValues: typeof getRandomValues;
|
|
170
|
+
getHashes: typeof getHashes;
|
|
171
|
+
getCiphers: typeof getCiphers;
|
|
172
|
+
timingSafeEqual: typeof timingSafeEqual;
|
|
173
|
+
webcrypto: Crypto;
|
|
174
|
+
};
|
|
175
|
+
export default _default;
|
|
176
|
+
//# sourceMappingURL=crypto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/node/crypto.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAMrC,KAAK,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;AACrE,KAAK,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,CAAC;AAyCxE,MAAM,WAAW,IAAI;IACnB;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,aAAa,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAE/D;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;IAE7C;;OAEG;IACH,IAAI,IAAI,IAAI,CAAC;CACd;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,IAAI,CAClB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,UAAU,EAChB,cAAc,CAAC,EAAE,QAAQ,GACxB,MAAM,GAAG,MAAM,CAIjB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CA4DlD;AAMD,MAAM,WAAW,IAAI;IACnB;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,aAAa,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAE/D;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;CAC9C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,SAAS,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B,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;AAC/C,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;AAC5D,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAC;AACnG,wBAAgB,SAAS,CACvB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,GACnD,IAAI,CAAC;AAmDR;;GAEG;AACH,wBAAgB,SAAS,IAAI,MAAM,EAAE,CAEpC;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,MAAM,EAAE,CAIrC;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,GAAG,UAAU,EAAE,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAWvF;AA2CD;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,eAAe,GAAG,IAAI,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,CAKlF;AAMD,eAAO,MAAM,SAAS,QAAS,CAAC;;;;;;;;;;;;;;;;;AAEhC,wBAeE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js dgram module implementation
|
|
3
|
+
*
|
|
4
|
+
* UDP sockets are not available in the browser environment.
|
|
5
|
+
* This provides stub implementations that throw on actual network operations.
|
|
6
|
+
*/
|
|
7
|
+
import { EventEmitter } from "./events.js";
|
|
8
|
+
export declare class Socket extends EventEmitter {
|
|
9
|
+
private _type;
|
|
10
|
+
constructor(type: string);
|
|
11
|
+
bind(_port?: number | object, _address?: string | (() => void), _callback?: () => void): this;
|
|
12
|
+
close(_callback?: () => void): void;
|
|
13
|
+
send(_msg: unknown, _offsetOrPort?: number, _lengthOrAddress?: number | string, _portOrCallback?: number | ((error: Error | null, bytes: number) => void), _addressOrCallback?: string | ((error: Error | null, bytes: number) => void), _callback?: (error: Error | null, bytes: number) => void): void;
|
|
14
|
+
address(): {
|
|
15
|
+
address: string;
|
|
16
|
+
family: string;
|
|
17
|
+
port: number;
|
|
18
|
+
};
|
|
19
|
+
ref(): this;
|
|
20
|
+
unref(): this;
|
|
21
|
+
setMulticastTTL(_ttl: number): this;
|
|
22
|
+
setMulticastLoopback(_flag: boolean): this;
|
|
23
|
+
addMembership(_multicastAddress: string, _multicastInterface?: string): void;
|
|
24
|
+
dropMembership(_multicastAddress: string, _multicastInterface?: string): void;
|
|
25
|
+
setBroadcast(_flag: boolean): void;
|
|
26
|
+
setTTL(_ttl: number): this;
|
|
27
|
+
getRecvBufferSize(): number;
|
|
28
|
+
getSendBufferSize(): number;
|
|
29
|
+
setRecvBufferSize(_size: number): void;
|
|
30
|
+
setSendBufferSize(_size: number): void;
|
|
31
|
+
remoteAddress(): {
|
|
32
|
+
address: string;
|
|
33
|
+
family: string;
|
|
34
|
+
port: number;
|
|
35
|
+
};
|
|
36
|
+
getSendQueueSize(): number;
|
|
37
|
+
getSendQueueCount(): number;
|
|
38
|
+
}
|
|
39
|
+
export declare function createSocket(options: string | {
|
|
40
|
+
type: string;
|
|
41
|
+
reuseAddr?: boolean;
|
|
42
|
+
signal?: unknown;
|
|
43
|
+
}, _callback?: (msg: Buffer, rinfo: unknown) => void): Socket;
|
|
44
|
+
//# sourceMappingURL=dgram.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dgram.d.ts","sourceRoot":"","sources":["../../src/node/dgram.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,qBAAa,MAAO,SAAQ,YAAY;IACtC,OA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F,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAG;IAErC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEzB;IAED,iBAAiB,IAAI,MAAM,CAE1B;IAED,iBAAiB,IAAI,MAAM,CAE1B;IAED,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAG;IACzC,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAG;IAEzC,aAAa,IAAI;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAEjE;IAED,gBAAgB,IAAI,MAAM,CAEzB;IAED,iBAAiB,IAAI,MAAM,CAE1B;CACF;AAED,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,EACzE,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,GAChD,MAAM,CAGR"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js diagnostics_channel module implementation
|
|
3
|
+
*
|
|
4
|
+
* Provides a pub/sub system for diagnostics data. Used by Fastify, undici,
|
|
5
|
+
* and other frameworks for tracing and observability.
|
|
6
|
+
*
|
|
7
|
+
* This is a real implementation (not a stub) — channels are functional
|
|
8
|
+
* and messages are delivered to subscribers.
|
|
9
|
+
*/
|
|
10
|
+
type MessageHandler = (message: unknown, name: string) => void;
|
|
11
|
+
export declare class Channel {
|
|
12
|
+
readonly name: string;
|
|
13
|
+
private _subscribers;
|
|
14
|
+
constructor(name: string);
|
|
15
|
+
get hasSubscribers(): boolean;
|
|
16
|
+
subscribe(onMessage: MessageHandler): void;
|
|
17
|
+
unsubscribe(onMessage: MessageHandler): boolean;
|
|
18
|
+
publish(message: unknown): void;
|
|
19
|
+
bindStore(_store: unknown, _transform?: (data: unknown) => unknown): void;
|
|
20
|
+
unbindStore(_store: unknown): void;
|
|
21
|
+
runStores(context: unknown, fn: (...args: unknown[]) => unknown, thisArg?: unknown, ...args: unknown[]): unknown;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get or create a named channel.
|
|
25
|
+
*/
|
|
26
|
+
export declare function channel(name: string): Channel;
|
|
27
|
+
/**
|
|
28
|
+
* Check if a named channel has any subscribers.
|
|
29
|
+
*/
|
|
30
|
+
export declare function hasSubscribers(name: string): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Subscribe to a named channel.
|
|
33
|
+
*/
|
|
34
|
+
export declare function subscribe(name: string, onMessage: MessageHandler): void;
|
|
35
|
+
/**
|
|
36
|
+
* Unsubscribe from a named channel.
|
|
37
|
+
*/
|
|
38
|
+
export declare function unsubscribe(name: string, onMessage: MessageHandler): boolean;
|
|
39
|
+
export declare class TracingChannel {
|
|
40
|
+
readonly start: Channel;
|
|
41
|
+
readonly end: Channel;
|
|
42
|
+
readonly asyncStart: Channel;
|
|
43
|
+
readonly asyncEnd: Channel;
|
|
44
|
+
readonly error: Channel;
|
|
45
|
+
constructor(nameOrChannels: string | Record<string, Channel>);
|
|
46
|
+
subscribe(handlers: Record<string, MessageHandler>): void;
|
|
47
|
+
unsubscribe(handlers: Record<string, MessageHandler>): void;
|
|
48
|
+
traceSync<T>(fn: (...args: unknown[]) => T, context?: object, thisArg?: unknown, ...args: unknown[]): T;
|
|
49
|
+
tracePromise<T>(fn: (...args: unknown[]) => T, context?: object, thisArg?: unknown, ...args: unknown[]): T;
|
|
50
|
+
traceCallback(fn: (...args: unknown[]) => unknown, _position?: number, context?: object, thisArg?: unknown, ...args: unknown[]): unknown;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Create a TracingChannel.
|
|
54
|
+
*/
|
|
55
|
+
export declare function tracingChannel(nameOrChannels: string | Record<string, Channel>): TracingChannel;
|
|
56
|
+
export {};
|
|
57
|
+
//# sourceMappingURL=diagnostics_channel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics_channel.d.ts","sourceRoot":"","sources":["../../src/node/diagnostics_channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAYH,KAAK,cAAc,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;AAE/D,qBAAa,OAAO;IAClB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,YAAY,CAAkC;IAEtD,YAAY,IAAI,EAAE,MAAM,EAEvB;IAED,IAAI,cAAc,IAAI,OAAO,CAE5B;IAED,SAAS,CAAC,SAAS,EAAE,cAAc,GAAG,IAAI,CAEzC;IAED,WAAW,CAAC,SAAS,EAAE,cAAc,GAAG,OAAO,CAE9C;IAED,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAK9B;IAED,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,GAAG,IAAI,CAGxE;IAED,WAAW,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAEjC;IAED,SAAS,CACP,OAAO,EAAE,OAAO,EAChB,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,EACnC,OAAO,CAAC,EAAE,OAAO,EACjB,GAAG,IAAI,EAAE,OAAO,EAAE,GACjB,OAAO,CAGT;CACF;AAMD;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAO7C;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGpD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EA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