prostgles-server 4.2.178 → 4.2.180

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/.vscode/settings.json +10 -1
  2. package/dist/DboBuilder/TableHandler/DataValidator.d.ts +1 -1
  3. package/dist/DboBuilder/TableHandler/DataValidator.d.ts.map +1 -1
  4. package/dist/DboBuilder/TableHandler/DataValidator.js +4 -4
  5. package/dist/DboBuilder/TableHandler/DataValidator.js.map +1 -1
  6. package/dist/DboBuilder/TableHandler/TableHandler.d.ts +1 -1
  7. package/dist/DboBuilder/TableHandler/TableHandler.d.ts.map +1 -1
  8. package/dist/DboBuilder/TableHandler/insert.js +3 -3
  9. package/dist/DboBuilder/TableHandler/insert.js.map +1 -1
  10. package/dist/DboBuilder/TableHandler/update.d.ts.map +1 -1
  11. package/dist/DboBuilder/TableHandler/update.js +45 -19
  12. package/dist/DboBuilder/TableHandler/update.js.map +1 -1
  13. package/dist/DboBuilder/ViewHandler/ViewHandler.d.ts +1 -1
  14. package/dist/DboBuilder/ViewHandler/ViewHandler.d.ts.map +1 -1
  15. package/dist/DboBuilder/ViewHandler/ViewHandler.js +2 -2
  16. package/dist/DboBuilder/ViewHandler/ViewHandler.js.map +1 -1
  17. package/dist/DboBuilder/parseUpdateRules.js +1 -1
  18. package/dist/DboBuilder/parseUpdateRules.js.map +1 -1
  19. package/dist/Logging.d.ts +10 -3
  20. package/dist/Logging.d.ts.map +1 -1
  21. package/dist/Prostgles.d.ts +2 -2
  22. package/dist/Prostgles.d.ts.map +1 -1
  23. package/dist/Prostgles.js +118 -53
  24. package/dist/Prostgles.js.map +1 -1
  25. package/dist/ProstglesTypes.d.ts +77 -23
  26. package/dist/ProstglesTypes.d.ts.map +1 -1
  27. package/dist/ProstglesTypes.js.map +1 -1
  28. package/dist/SyncReplication.js +2 -2
  29. package/dist/SyncReplication.js.map +1 -1
  30. package/dist/initProstgles.d.ts +9 -2
  31. package/dist/initProstgles.d.ts.map +1 -1
  32. package/dist/initProstgles.js +65 -57
  33. package/dist/initProstgles.js.map +1 -1
  34. package/dist/utils.d.ts.map +1 -1
  35. package/dist/utils.js.map +1 -1
  36. package/documentation/CLIENT.md +542 -0
  37. package/documentation/SERVER.md +104 -0
  38. package/documentation/utils/clientTypes.ts +8436 -0
  39. package/documentation/utils/dist/clientTypes.d.ts +7705 -0
  40. package/documentation/utils/dist/clientTypes.d.ts.map +1 -0
  41. package/documentation/utils/dist/clientTypes.js +8438 -0
  42. package/documentation/utils/dist/definitions.d.ts +7705 -0
  43. package/documentation/utils/dist/definitions.d.ts.map +1 -0
  44. package/documentation/utils/dist/definitions.js +8438 -0
  45. package/documentation/utils/dist/generateClientDocs.d.ts +3 -0
  46. package/documentation/utils/dist/generateClientDocs.d.ts.map +1 -0
  47. package/documentation/utils/dist/generateClientDocs.js +115 -0
  48. package/documentation/utils/dist/generateDocs.d.ts +2 -0
  49. package/documentation/utils/dist/generateDocs.d.ts.map +1 -0
  50. package/documentation/utils/dist/generateDocs.js +6 -0
  51. package/documentation/utils/dist/generateMarkdown.d.ts +2 -0
  52. package/documentation/utils/dist/generateMarkdown.d.ts.map +1 -0
  53. package/documentation/utils/dist/generateMarkdown.js +68 -0
  54. package/documentation/utils/dist/generateServerDocs.d.ts +2 -0
  55. package/documentation/utils/dist/generateServerDocs.d.ts.map +1 -0
  56. package/documentation/utils/dist/generateServerDocs.js +80 -0
  57. package/documentation/utils/dist/getResolvedTypes.d.ts +15 -0
  58. package/documentation/utils/dist/getResolvedTypes.d.ts.map +1 -0
  59. package/documentation/utils/dist/getResolvedTypes.js +29 -0
  60. package/documentation/utils/dist/getSerializableType.d.ts +69 -0
  61. package/documentation/utils/dist/getSerializableType.d.ts.map +1 -0
  62. package/documentation/utils/dist/getSerializableType.js +273 -0
  63. package/documentation/utils/dist/getSymbolComments.d.ts +11 -0
  64. package/documentation/utils/dist/getSymbolComments.d.ts.map +1 -0
  65. package/documentation/utils/dist/getSymbolComments.js +60 -0
  66. package/documentation/utils/dist/loadTsFile.d.ts +7 -0
  67. package/documentation/utils/dist/loadTsFile.d.ts.map +1 -0
  68. package/documentation/utils/dist/loadTsFile.js +33 -0
  69. package/documentation/utils/dist/moduleResolver.d.ts +9 -0
  70. package/documentation/utils/dist/moduleResolver.d.ts.map +1 -0
  71. package/documentation/utils/dist/moduleResolver.js +27 -0
  72. package/documentation/utils/dist/serverTypes.d.ts +307 -0
  73. package/documentation/utils/dist/serverTypes.d.ts.map +1 -0
  74. package/documentation/utils/dist/serverTypes.js +347 -0
  75. package/documentation/utils/generateClientDocs.ts +142 -0
  76. package/documentation/utils/generateDocs.ts +4 -0
  77. package/documentation/utils/generateServerDocs.ts +82 -0
  78. package/documentation/utils/getResolvedTypes.ts +45 -0
  79. package/documentation/utils/getSerializableType.ts +479 -0
  80. package/documentation/utils/loadTsFile.ts +45 -0
  81. package/documentation/utils/moduleResolver.ts +31 -0
  82. package/documentation/utils/node_modules/.package-lock.json +67 -0
  83. package/documentation/utils/node_modules/@types/node/LICENSE +21 -0
  84. package/documentation/utils/node_modules/@types/node/README.md +15 -0
  85. package/documentation/utils/node_modules/@types/node/assert/strict.d.ts +8 -0
  86. package/documentation/utils/node_modules/@types/node/assert.d.ts +1040 -0
  87. package/documentation/utils/node_modules/@types/node/async_hooks.d.ts +541 -0
  88. package/documentation/utils/node_modules/@types/node/buffer.buffer.d.ts +385 -0
  89. package/documentation/utils/node_modules/@types/node/buffer.d.ts +1934 -0
  90. package/documentation/utils/node_modules/@types/node/child_process.d.ts +1548 -0
  91. package/documentation/utils/node_modules/@types/node/cluster.d.ts +578 -0
  92. package/documentation/utils/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  93. package/documentation/utils/node_modules/@types/node/compatibility/index.d.ts +9 -0
  94. package/documentation/utils/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
  95. package/documentation/utils/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  96. package/documentation/utils/node_modules/@types/node/console.d.ts +452 -0
  97. package/documentation/utils/node_modules/@types/node/constants.d.ts +19 -0
  98. package/documentation/utils/node_modules/@types/node/crypto.d.ts +4519 -0
  99. package/documentation/utils/node_modules/@types/node/dgram.d.ts +596 -0
  100. package/documentation/utils/node_modules/@types/node/diagnostics_channel.d.ts +554 -0
  101. package/documentation/utils/node_modules/@types/node/dns/promises.d.ts +477 -0
  102. package/documentation/utils/node_modules/@types/node/dns.d.ts +864 -0
  103. package/documentation/utils/node_modules/@types/node/dom-events.d.ts +124 -0
  104. package/documentation/utils/node_modules/@types/node/domain.d.ts +170 -0
  105. package/documentation/utils/node_modules/@types/node/events.d.ts +931 -0
  106. package/documentation/utils/node_modules/@types/node/fs/promises.d.ts +1245 -0
  107. package/documentation/utils/node_modules/@types/node/fs.d.ts +4317 -0
  108. package/documentation/utils/node_modules/@types/node/globals.d.ts +468 -0
  109. package/documentation/utils/node_modules/@types/node/globals.typedarray.d.ts +21 -0
  110. package/documentation/utils/node_modules/@types/node/http.d.ts +1944 -0
  111. package/documentation/utils/node_modules/@types/node/http2.d.ts +2555 -0
  112. package/documentation/utils/node_modules/@types/node/https.d.ts +544 -0
  113. package/documentation/utils/node_modules/@types/node/index.d.ts +91 -0
  114. package/documentation/utils/node_modules/@types/node/inspector.d.ts +3696 -0
  115. package/documentation/utils/node_modules/@types/node/module.d.ts +315 -0
  116. package/documentation/utils/node_modules/@types/node/net.d.ts +1005 -0
  117. package/documentation/utils/node_modules/@types/node/os.d.ts +495 -0
  118. package/documentation/utils/node_modules/@types/node/package.json +220 -0
  119. package/documentation/utils/node_modules/@types/node/path.d.ts +200 -0
  120. package/documentation/utils/node_modules/@types/node/perf_hooks.d.ts +934 -0
  121. package/documentation/utils/node_modules/@types/node/process.d.ts +1879 -0
  122. package/documentation/utils/node_modules/@types/node/punycode.d.ts +117 -0
  123. package/documentation/utils/node_modules/@types/node/querystring.d.ts +153 -0
  124. package/documentation/utils/node_modules/@types/node/readline/promises.d.ts +162 -0
  125. package/documentation/utils/node_modules/@types/node/readline.d.ts +589 -0
  126. package/documentation/utils/node_modules/@types/node/repl.d.ts +430 -0
  127. package/documentation/utils/node_modules/@types/node/sea.d.ts +153 -0
  128. package/documentation/utils/node_modules/@types/node/stream/consumers.d.ts +12 -0
  129. package/documentation/utils/node_modules/@types/node/stream/promises.d.ts +90 -0
  130. package/documentation/utils/node_modules/@types/node/stream/web.d.ts +524 -0
  131. package/documentation/utils/node_modules/@types/node/stream.d.ts +1726 -0
  132. package/documentation/utils/node_modules/@types/node/string_decoder.d.ts +67 -0
  133. package/documentation/utils/node_modules/@types/node/test.d.ts +1938 -0
  134. package/documentation/utils/node_modules/@types/node/timers/promises.d.ts +97 -0
  135. package/documentation/utils/node_modules/@types/node/timers.d.ts +240 -0
  136. package/documentation/utils/node_modules/@types/node/tls.d.ts +1217 -0
  137. package/documentation/utils/node_modules/@types/node/trace_events.d.ts +197 -0
  138. package/documentation/utils/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +385 -0
  139. package/documentation/utils/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +19 -0
  140. package/documentation/utils/node_modules/@types/node/ts5.6/index.d.ts +91 -0
  141. package/documentation/utils/node_modules/@types/node/tty.d.ts +208 -0
  142. package/documentation/utils/node_modules/@types/node/url.d.ts +955 -0
  143. package/documentation/utils/node_modules/@types/node/util.d.ts +2306 -0
  144. package/documentation/utils/node_modules/@types/node/v8.d.ts +808 -0
  145. package/documentation/utils/node_modules/@types/node/vm.d.ts +922 -0
  146. package/documentation/utils/node_modules/@types/node/wasi.d.ts +181 -0
  147. package/documentation/utils/node_modules/@types/node/worker_threads.d.ts +694 -0
  148. package/documentation/utils/node_modules/@types/node/zlib.d.ts +539 -0
  149. package/documentation/utils/node_modules/undici-types/LICENSE +21 -0
  150. package/documentation/utils/node_modules/undici-types/README.md +6 -0
  151. package/documentation/utils/node_modules/undici-types/agent.d.ts +31 -0
  152. package/documentation/utils/node_modules/undici-types/api.d.ts +43 -0
  153. package/documentation/utils/node_modules/undici-types/balanced-pool.d.ts +29 -0
  154. package/documentation/utils/node_modules/undici-types/cache.d.ts +36 -0
  155. package/documentation/utils/node_modules/undici-types/client.d.ts +108 -0
  156. package/documentation/utils/node_modules/undici-types/connector.d.ts +34 -0
  157. package/documentation/utils/node_modules/undici-types/content-type.d.ts +21 -0
  158. package/documentation/utils/node_modules/undici-types/cookies.d.ts +28 -0
  159. package/documentation/utils/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
  160. package/documentation/utils/node_modules/undici-types/dispatcher.d.ts +255 -0
  161. package/documentation/utils/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
  162. package/documentation/utils/node_modules/undici-types/errors.d.ts +149 -0
  163. package/documentation/utils/node_modules/undici-types/eventsource.d.ts +63 -0
  164. package/documentation/utils/node_modules/undici-types/fetch.d.ts +209 -0
  165. package/documentation/utils/node_modules/undici-types/file.d.ts +39 -0
  166. package/documentation/utils/node_modules/undici-types/filereader.d.ts +54 -0
  167. package/documentation/utils/node_modules/undici-types/formdata.d.ts +108 -0
  168. package/documentation/utils/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  169. package/documentation/utils/node_modules/undici-types/global-origin.d.ts +7 -0
  170. package/documentation/utils/node_modules/undici-types/handlers.d.ts +15 -0
  171. package/documentation/utils/node_modules/undici-types/header.d.ts +4 -0
  172. package/documentation/utils/node_modules/undici-types/index.d.ts +71 -0
  173. package/documentation/utils/node_modules/undici-types/interceptors.d.ts +15 -0
  174. package/documentation/utils/node_modules/undici-types/mock-agent.d.ts +50 -0
  175. package/documentation/utils/node_modules/undici-types/mock-client.d.ts +25 -0
  176. package/documentation/utils/node_modules/undici-types/mock-errors.d.ts +12 -0
  177. package/documentation/utils/node_modules/undici-types/mock-interceptor.d.ts +93 -0
  178. package/documentation/utils/node_modules/undici-types/mock-pool.d.ts +25 -0
  179. package/documentation/utils/node_modules/undici-types/package.json +55 -0
  180. package/documentation/utils/node_modules/undici-types/patch.d.ts +71 -0
  181. package/documentation/utils/node_modules/undici-types/pool-stats.d.ts +19 -0
  182. package/documentation/utils/node_modules/undici-types/pool.d.ts +39 -0
  183. package/documentation/utils/node_modules/undici-types/proxy-agent.d.ts +28 -0
  184. package/documentation/utils/node_modules/undici-types/readable.d.ts +60 -0
  185. package/documentation/utils/node_modules/undici-types/retry-agent.d.ts +8 -0
  186. package/documentation/utils/node_modules/undici-types/retry-handler.d.ts +116 -0
  187. package/documentation/utils/node_modules/undici-types/util.d.ts +18 -0
  188. package/documentation/utils/node_modules/undici-types/webidl.d.ts +222 -0
  189. package/documentation/utils/node_modules/undici-types/websocket.d.ts +152 -0
  190. package/documentation/utils/package-lock.json +75 -0
  191. package/documentation/utils/package.json +14 -0
  192. package/documentation/utils/serverTypes.ts +345 -0
  193. package/documentation/utils/tsconfig.json +28 -0
  194. package/examples/full-example-typescript/DBoGenerated.d.ts +2 -2
  195. package/examples/full-example-typescript/DBoGenerated.ts +2 -2
  196. package/examples/full-example-typescript/index.ts +39 -45
  197. package/examples/full-example-vanilla/index.js +51 -53
  198. package/examples/server/typescript/index.ts +24 -30
  199. package/lib/DboBuilder/TableHandler/DataValidator.ts +5 -5
  200. package/lib/DboBuilder/TableHandler/TableHandler.ts +1 -1
  201. package/lib/DboBuilder/TableHandler/insert.ts +3 -3
  202. package/lib/DboBuilder/TableHandler/update.ts +106 -48
  203. package/lib/DboBuilder/ViewHandler/ViewHandler.ts +2 -2
  204. package/lib/DboBuilder/parseUpdateRules.ts +1 -1
  205. package/lib/Logging.ts +7 -3
  206. package/lib/Prostgles.ts +209 -142
  207. package/lib/ProstglesTypes.ts +130 -51
  208. package/lib/SyncReplication.ts +2 -2
  209. package/lib/initProstgles.ts +145 -111
  210. package/lib/utils.ts +4 -5
  211. package/package.json +3 -2
  212. package/examples/server/typescript/index.d.ts +0 -2
  213. package/examples/server/typescript/index.d.ts.map +0 -1
  214. package/examples/server/typescript/index.js +0 -54
  215. package/examples/server/typescript/index.js.map +0 -1
@@ -0,0 +1,468 @@
1
+ export {}; // Make this a module
2
+
3
+ // #region Fetch and friends
4
+ // Conditional type aliases, used at the end of this file.
5
+ // Will either be empty if lib-dom is included, or the undici version otherwise.
6
+ type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request;
7
+ type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response;
8
+ type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData;
9
+ type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers;
10
+ type _MessageEvent = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").MessageEvent;
11
+ type _RequestInit = typeof globalThis extends { onmessage: any } ? {}
12
+ : import("undici-types").RequestInit;
13
+ type _ResponseInit = typeof globalThis extends { onmessage: any } ? {}
14
+ : import("undici-types").ResponseInit;
15
+ // #endregion Fetch and friends
16
+
17
+ // #region DOMException
18
+ type _DOMException = typeof globalThis extends { onmessage: any } ? {} : NodeDOMException;
19
+ interface NodeDOMException extends Error {
20
+ /**
21
+ * @deprecated
22
+ *
23
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
24
+ */
25
+ readonly code: number;
26
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */
27
+ readonly message: string;
28
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */
29
+ readonly name: string;
30
+ readonly INDEX_SIZE_ERR: 1;
31
+ readonly DOMSTRING_SIZE_ERR: 2;
32
+ readonly HIERARCHY_REQUEST_ERR: 3;
33
+ readonly WRONG_DOCUMENT_ERR: 4;
34
+ readonly INVALID_CHARACTER_ERR: 5;
35
+ readonly NO_DATA_ALLOWED_ERR: 6;
36
+ readonly NO_MODIFICATION_ALLOWED_ERR: 7;
37
+ readonly NOT_FOUND_ERR: 8;
38
+ readonly NOT_SUPPORTED_ERR: 9;
39
+ readonly INUSE_ATTRIBUTE_ERR: 10;
40
+ readonly INVALID_STATE_ERR: 11;
41
+ readonly SYNTAX_ERR: 12;
42
+ readonly INVALID_MODIFICATION_ERR: 13;
43
+ readonly NAMESPACE_ERR: 14;
44
+ readonly INVALID_ACCESS_ERR: 15;
45
+ readonly VALIDATION_ERR: 16;
46
+ readonly TYPE_MISMATCH_ERR: 17;
47
+ readonly SECURITY_ERR: 18;
48
+ readonly NETWORK_ERR: 19;
49
+ readonly ABORT_ERR: 20;
50
+ readonly URL_MISMATCH_ERR: 21;
51
+ readonly QUOTA_EXCEEDED_ERR: 22;
52
+ readonly TIMEOUT_ERR: 23;
53
+ readonly INVALID_NODE_TYPE_ERR: 24;
54
+ readonly DATA_CLONE_ERR: 25;
55
+ }
56
+ interface NodeDOMExceptionConstructor {
57
+ prototype: DOMException;
58
+ new(message?: string, nameOrOptions?: string | { name?: string; cause?: unknown }): DOMException;
59
+ readonly INDEX_SIZE_ERR: 1;
60
+ readonly DOMSTRING_SIZE_ERR: 2;
61
+ readonly HIERARCHY_REQUEST_ERR: 3;
62
+ readonly WRONG_DOCUMENT_ERR: 4;
63
+ readonly INVALID_CHARACTER_ERR: 5;
64
+ readonly NO_DATA_ALLOWED_ERR: 6;
65
+ readonly NO_MODIFICATION_ALLOWED_ERR: 7;
66
+ readonly NOT_FOUND_ERR: 8;
67
+ readonly NOT_SUPPORTED_ERR: 9;
68
+ readonly INUSE_ATTRIBUTE_ERR: 10;
69
+ readonly INVALID_STATE_ERR: 11;
70
+ readonly SYNTAX_ERR: 12;
71
+ readonly INVALID_MODIFICATION_ERR: 13;
72
+ readonly NAMESPACE_ERR: 14;
73
+ readonly INVALID_ACCESS_ERR: 15;
74
+ readonly VALIDATION_ERR: 16;
75
+ readonly TYPE_MISMATCH_ERR: 17;
76
+ readonly SECURITY_ERR: 18;
77
+ readonly NETWORK_ERR: 19;
78
+ readonly ABORT_ERR: 20;
79
+ readonly URL_MISMATCH_ERR: 21;
80
+ readonly QUOTA_EXCEEDED_ERR: 22;
81
+ readonly TIMEOUT_ERR: 23;
82
+ readonly INVALID_NODE_TYPE_ERR: 24;
83
+ readonly DATA_CLONE_ERR: 25;
84
+ }
85
+ // #endregion DOMException
86
+
87
+ declare global {
88
+ // Declare "static" methods in Error
89
+ interface ErrorConstructor {
90
+ /** Create .stack property on a target object */
91
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
92
+
93
+ /**
94
+ * Optional override for formatting stack traces
95
+ *
96
+ * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces
97
+ */
98
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
99
+
100
+ stackTraceLimit: number;
101
+ }
102
+
103
+ /*-----------------------------------------------*
104
+ * *
105
+ * GLOBAL *
106
+ * *
107
+ ------------------------------------------------*/
108
+
109
+ // For backwards compability
110
+ interface NodeRequire extends NodeJS.Require {}
111
+ interface RequireResolve extends NodeJS.RequireResolve {}
112
+ interface NodeModule extends NodeJS.Module {}
113
+
114
+ var global: typeof globalThis;
115
+
116
+ var process: NodeJS.Process;
117
+ var console: Console;
118
+
119
+ var __filename: string;
120
+ var __dirname: string;
121
+
122
+ var require: NodeRequire;
123
+ var module: NodeModule;
124
+
125
+ // Same as module.exports
126
+ var exports: any;
127
+
128
+ interface GCFunction {
129
+ (options: {
130
+ execution?: "sync";
131
+ type?: "major" | "minor";
132
+ }): void;
133
+ (options: {
134
+ execution: "async";
135
+ type?: "major" | "minor";
136
+ }): Promise<void>;
137
+ (options?: boolean): void;
138
+ }
139
+
140
+ /**
141
+ * Only available if `--expose-gc` is passed to the process.
142
+ */
143
+ var gc: undefined | GCFunction;
144
+
145
+ // #region borrowed
146
+ // from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib
147
+ /** A controller object that allows you to abort one or more DOM requests as and when desired. */
148
+ interface AbortController {
149
+ /**
150
+ * Returns the AbortSignal object associated with this object.
151
+ */
152
+
153
+ readonly signal: AbortSignal;
154
+ /**
155
+ * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
156
+ */
157
+ abort(reason?: any): void;
158
+ }
159
+
160
+ /** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */
161
+ interface AbortSignal extends EventTarget {
162
+ /**
163
+ * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
164
+ */
165
+ readonly aborted: boolean;
166
+ readonly reason: any;
167
+ onabort: null | ((this: AbortSignal, event: Event) => any);
168
+ throwIfAborted(): void;
169
+ }
170
+
171
+ var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T
172
+ : {
173
+ prototype: AbortController;
174
+ new(): AbortController;
175
+ };
176
+
177
+ var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T
178
+ : {
179
+ prototype: AbortSignal;
180
+ new(): AbortSignal;
181
+ abort(reason?: any): AbortSignal;
182
+ timeout(milliseconds: number): AbortSignal;
183
+ any(signals: AbortSignal[]): AbortSignal;
184
+ };
185
+ // #endregion borrowed
186
+
187
+ /**
188
+ * @since v17.0.0
189
+ *
190
+ * Creates a deep clone of an object.
191
+ */
192
+ function structuredClone<T>(
193
+ value: T,
194
+ transfer?: { transfer: ReadonlyArray<import("worker_threads").TransferListItem> },
195
+ ): T;
196
+
197
+ // #region DOMException
198
+ /**
199
+ * @since v17.0.0
200
+ * An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API.
201
+ *
202
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
203
+ */
204
+ interface DOMException extends _DOMException {}
205
+
206
+ /**
207
+ * @since v17.0.0
208
+ *
209
+ * The WHATWG `DOMException` class. See [DOMException](https://developer.mozilla.org/docs/Web/API/DOMException) for more details.
210
+ */
211
+ var DOMException: typeof globalThis extends { onmessage: any; DOMException: infer T } ? T
212
+ : NodeDOMExceptionConstructor;
213
+ // #endregion DOMException
214
+
215
+ /*----------------------------------------------*
216
+ * *
217
+ * GLOBAL INTERFACES *
218
+ * *
219
+ *-----------------------------------------------*/
220
+ namespace NodeJS {
221
+ interface CallSite {
222
+ /**
223
+ * Value of "this"
224
+ */
225
+ getThis(): unknown;
226
+
227
+ /**
228
+ * Type of "this" as a string.
229
+ * This is the name of the function stored in the constructor field of
230
+ * "this", if available. Otherwise the object's [[Class]] internal
231
+ * property.
232
+ */
233
+ getTypeName(): string | null;
234
+
235
+ /**
236
+ * Current function
237
+ */
238
+ getFunction(): Function | undefined;
239
+
240
+ /**
241
+ * Name of the current function, typically its name property.
242
+ * If a name property is not available an attempt will be made to try
243
+ * to infer a name from the function's context.
244
+ */
245
+ getFunctionName(): string | null;
246
+
247
+ /**
248
+ * Name of the property [of "this" or one of its prototypes] that holds
249
+ * the current function
250
+ */
251
+ getMethodName(): string | null;
252
+
253
+ /**
254
+ * Name of the script [if this function was defined in a script]
255
+ */
256
+ getFileName(): string | undefined;
257
+
258
+ /**
259
+ * Current line number [if this function was defined in a script]
260
+ */
261
+ getLineNumber(): number | null;
262
+
263
+ /**
264
+ * Current column number [if this function was defined in a script]
265
+ */
266
+ getColumnNumber(): number | null;
267
+
268
+ /**
269
+ * A call site object representing the location where eval was called
270
+ * [if this function was created using a call to eval]
271
+ */
272
+ getEvalOrigin(): string | undefined;
273
+
274
+ /**
275
+ * Is this a toplevel invocation, that is, is "this" the global object?
276
+ */
277
+ isToplevel(): boolean;
278
+
279
+ /**
280
+ * Does this call take place in code defined by a call to eval?
281
+ */
282
+ isEval(): boolean;
283
+
284
+ /**
285
+ * Is this call in native V8 code?
286
+ */
287
+ isNative(): boolean;
288
+
289
+ /**
290
+ * Is this a constructor call?
291
+ */
292
+ isConstructor(): boolean;
293
+
294
+ /**
295
+ * is this an async call (i.e. await, Promise.all(), or Promise.any())?
296
+ */
297
+ isAsync(): boolean;
298
+
299
+ /**
300
+ * is this an async call to Promise.all()?
301
+ */
302
+ isPromiseAll(): boolean;
303
+
304
+ /**
305
+ * returns the index of the promise element that was followed in
306
+ * Promise.all() or Promise.any() for async stack traces, or null
307
+ * if the CallSite is not an async
308
+ */
309
+ getPromiseIndex(): number | null;
310
+
311
+ getScriptNameOrSourceURL(): string;
312
+ getScriptHash(): string;
313
+
314
+ getEnclosingColumnNumber(): number;
315
+ getEnclosingLineNumber(): number;
316
+ getPosition(): number;
317
+
318
+ toString(): string;
319
+ }
320
+
321
+ interface ErrnoException extends Error {
322
+ errno?: number | undefined;
323
+ code?: string | undefined;
324
+ path?: string | undefined;
325
+ syscall?: string | undefined;
326
+ }
327
+
328
+ interface ReadableStream extends EventEmitter {
329
+ readable: boolean;
330
+ read(size?: number): string | Buffer;
331
+ setEncoding(encoding: BufferEncoding): this;
332
+ pause(): this;
333
+ resume(): this;
334
+ isPaused(): boolean;
335
+ pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined }): T;
336
+ unpipe(destination?: WritableStream): this;
337
+ unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
338
+ wrap(oldStream: ReadableStream): this;
339
+ [Symbol.asyncIterator](): NodeJS.AsyncIterator<string | Buffer>;
340
+ }
341
+
342
+ interface WritableStream extends EventEmitter {
343
+ writable: boolean;
344
+ write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
345
+ write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
346
+ end(cb?: () => void): this;
347
+ end(data: string | Uint8Array, cb?: () => void): this;
348
+ end(str: string, encoding?: BufferEncoding, cb?: () => void): this;
349
+ }
350
+
351
+ interface ReadWriteStream extends ReadableStream, WritableStream {}
352
+
353
+ interface RefCounted {
354
+ ref(): this;
355
+ unref(): this;
356
+ }
357
+
358
+ interface Require {
359
+ (id: string): any;
360
+ resolve: RequireResolve;
361
+ cache: Dict<NodeModule>;
362
+ /**
363
+ * @deprecated
364
+ */
365
+ extensions: RequireExtensions;
366
+ main: Module | undefined;
367
+ }
368
+
369
+ interface RequireResolve {
370
+ (id: string, options?: { paths?: string[] | undefined }): string;
371
+ paths(request: string): string[] | null;
372
+ }
373
+
374
+ interface RequireExtensions extends Dict<(m: Module, filename: string) => any> {
375
+ ".js": (m: Module, filename: string) => any;
376
+ ".json": (m: Module, filename: string) => any;
377
+ ".node": (m: Module, filename: string) => any;
378
+ }
379
+ interface Module {
380
+ /**
381
+ * `true` if the module is running during the Node.js preload
382
+ */
383
+ isPreloading: boolean;
384
+ exports: any;
385
+ require: Require;
386
+ id: string;
387
+ filename: string;
388
+ loaded: boolean;
389
+ /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */
390
+ parent: Module | null | undefined;
391
+ children: Module[];
392
+ /**
393
+ * @since v11.14.0
394
+ *
395
+ * The directory name of the module. This is usually the same as the path.dirname() of the module.id.
396
+ */
397
+ path: string;
398
+ paths: string[];
399
+ }
400
+
401
+ interface Dict<T> {
402
+ [key: string]: T | undefined;
403
+ }
404
+
405
+ interface ReadOnlyDict<T> {
406
+ readonly [key: string]: T | undefined;
407
+ }
408
+
409
+ /** An iterable iterator returned by the Node.js API. */
410
+ // Default TReturn/TNext in v20 is `any`, for compatibility with the previously-used IterableIterator.
411
+ interface Iterator<T, TReturn = any, TNext = any> extends IteratorObject<T, TReturn, TNext> {
412
+ [Symbol.iterator](): NodeJS.Iterator<T, TReturn, TNext>;
413
+ }
414
+
415
+ /** An async iterable iterator returned by the Node.js API. */
416
+ // Default TReturn/TNext in v20 is `any`, for compatibility with the previously-used AsyncIterableIterator.
417
+ interface AsyncIterator<T, TReturn = any, TNext = any> extends AsyncIteratorObject<T, TReturn, TNext> {
418
+ [Symbol.asyncIterator](): NodeJS.AsyncIterator<T, TReturn, TNext>;
419
+ }
420
+ }
421
+
422
+ interface RequestInit extends _RequestInit {}
423
+
424
+ function fetch(
425
+ input: string | URL | globalThis.Request,
426
+ init?: RequestInit,
427
+ ): Promise<Response>;
428
+
429
+ interface Request extends _Request {}
430
+ var Request: typeof globalThis extends {
431
+ onmessage: any;
432
+ Request: infer T;
433
+ } ? T
434
+ : typeof import("undici-types").Request;
435
+
436
+ interface ResponseInit extends _ResponseInit {}
437
+
438
+ interface Response extends _Response {}
439
+ var Response: typeof globalThis extends {
440
+ onmessage: any;
441
+ Response: infer T;
442
+ } ? T
443
+ : typeof import("undici-types").Response;
444
+
445
+ interface FormData extends _FormData {}
446
+ var FormData: typeof globalThis extends {
447
+ onmessage: any;
448
+ FormData: infer T;
449
+ } ? T
450
+ : typeof import("undici-types").FormData;
451
+
452
+ interface Headers extends _Headers {}
453
+ var Headers: typeof globalThis extends {
454
+ onmessage: any;
455
+ Headers: infer T;
456
+ } ? T
457
+ : typeof import("undici-types").Headers;
458
+
459
+ interface MessageEvent extends _MessageEvent {}
460
+ /**
461
+ * @since v15.0.0
462
+ */
463
+ var MessageEvent: typeof globalThis extends {
464
+ onmessage: any;
465
+ MessageEvent: infer T;
466
+ } ? T
467
+ : typeof import("undici-types").MessageEvent;
468
+ }
@@ -0,0 +1,21 @@
1
+ export {}; // Make this a module
2
+
3
+ declare global {
4
+ namespace NodeJS {
5
+ type TypedArray<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> =
6
+ | Uint8Array<TArrayBuffer>
7
+ | Uint8ClampedArray<TArrayBuffer>
8
+ | Uint16Array<TArrayBuffer>
9
+ | Uint32Array<TArrayBuffer>
10
+ | Int8Array<TArrayBuffer>
11
+ | Int16Array<TArrayBuffer>
12
+ | Int32Array<TArrayBuffer>
13
+ | BigUint64Array<TArrayBuffer>
14
+ | BigInt64Array<TArrayBuffer>
15
+ | Float32Array<TArrayBuffer>
16
+ | Float64Array<TArrayBuffer>;
17
+ type ArrayBufferView<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> =
18
+ | TypedArray<TArrayBuffer>
19
+ | DataView<TArrayBuffer>;
20
+ }
21
+ }