socket-function 0.158.0 → 0.160.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "socket-function",
3
- "version": "0.158.0",
3
+ "version": "0.160.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -20,6 +20,8 @@
20
20
  "emit-dts": "yarn tsc --project tsconfig.declarations.json || exit 0",
21
21
  "generate-index-dts": "node ./generateIndexDts.js",
22
22
  "update-typings": "yarn generate-index-dts && yarn emit-dts",
23
+ "update-types": "yarn emit-dts && yarn generate-index-dts",
24
+ "prepublishOnly": "yarn update-types",
23
25
  "testsni": "yarn typenode ./src/sniTest.ts"
24
26
  },
25
27
  "devDependencies": {
@@ -1,4 +1,4 @@
1
- /// <reference path="../index.d.ts" />
1
+ /// <reference path="../src/src.d.ts" />
2
2
  declare global {
3
3
  var onProgressHandler: undefined | ((progress: {
4
4
  type: string;
@@ -1,4 +1,4 @@
1
- /// <reference path="../index.d.ts" />
1
+ /// <reference path="../src/src.d.ts" />
2
2
 
3
3
  import { GetModulesArgs } from "./RequireController";
4
4
 
package/src/src.d.ts ADDED
@@ -0,0 +1,43 @@
1
+ /// <reference path="./node_modules/typenode/index.d.ts" />
2
+
3
+ export { };
4
+
5
+ declare global {
6
+ namespace NodeJS {
7
+ interface Module {
8
+ original?: SerializedModule;
9
+ }
10
+ }
11
+ interface SerializedModule {
12
+ originalId: string;
13
+ filename: string;
14
+ // If a module is not allowed clientside it is likely requests will be empty,
15
+ // to save effort parsing requests for modules that only exist to give better
16
+ // error messages.
17
+ requests: {
18
+ // request => resolvedPath
19
+ [request: string]: string;
20
+ };
21
+ asyncRequests: { [request: string]: true };
22
+ // NOTE: IF !allowclient && !serveronly, it might just mean we didn't add allowclient
23
+ // to the module yet. BUT, if serveronly, then we know for sure we don't want it client.
24
+ // So the messages and behavior will be different.
25
+ allowclient?: boolean;
26
+ serveronly?: boolean;
27
+ // Just for errors mostly
28
+ alwayssend?: boolean;
29
+
30
+ /** Only set if allowclient. */
31
+ source?: string;
32
+
33
+ seqNum: number;
34
+
35
+ size?: number;
36
+ version?: number;
37
+
38
+ flags?: {
39
+ [flag: string]: true;
40
+ };
41
+ }
42
+
43
+ }