@7h3laughingman/foundry-helpers 13.351.1 → 13.351.2

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.
@@ -0,0 +1,54 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-function-type */
2
+ export {};
3
+
4
+ declare global {
5
+ namespace globalThis {
6
+ const socketlib: Socketlib;
7
+ }
8
+
9
+ export class Socketlib {
10
+ modules: Map<string, SocketlibSocket>;
11
+ system?: SocketlibSocket;
12
+ errors: {
13
+ SocketlibError: Error;
14
+ SocketlibInternalError: Error;
15
+ SocketlibInvalidUserError: Error;
16
+ SocketlibNoGMConnectedError: Error;
17
+ socketlibRemoteException: Error;
18
+ SocketlibUnregisteredHandlerError: Error;
19
+ };
20
+
21
+ registerModule(moduleName: string): SocketlibSocket | undefined;
22
+ registerSystem(systemId: string): SocketlibSocket | undefined;
23
+ }
24
+
25
+ export class SocketlibSocket {
26
+ functions: Map<string, Function>;
27
+ socketName: string;
28
+ pendingRequests: Map<
29
+ string,
30
+ {
31
+ handlerName: string;
32
+ resolve: (value: unknown) => void;
33
+ reject: (value: unknown) => void;
34
+ recipient: string;
35
+ }
36
+ >;
37
+
38
+ register(name: string, func: Function): void;
39
+ executeAsGM<T = unknown>(handler: string | Function, ...args: unknown[]): Promise<T>;
40
+ executeAsUser<T = unknown>(handler: string | Function, userId: string, ...args: unknown[]): Promise<T>;
41
+ executeForAllGMs<T = unknown>(handler: string | Function, ...args: unknown[]): Promise<T>;
42
+ executeForOtherGMs<T = unknown>(handler: string | Function, ...args: unknown[]): Promise<T>;
43
+ executeForEveryone<T = unknown>(handler: string | Function, ...args: unknown[]): Promise<T>;
44
+ executeForOthers<T = unknown>(handler: string | Function, ...args: unknown[]): Promise<T>;
45
+ executeForUsers<T = unknown>(handler: string | Function, recipients: string[], ...args: unknown[]): Promise<T>;
46
+ }
47
+ }
48
+
49
+ declare module "foundry-types/client/helpers/hooks.mjs" {
50
+ namespace Hooks {
51
+ function on(hook: "socketlib.ready", callback: () => boolean | void | Promise<boolean | void>): number;
52
+ function once(hook: "socketlib.ready", callback: () => boolean | void | Promise<boolean | void>): number;
53
+ }
54
+ }
@@ -3,5 +3,5 @@ export function isRoll(value) {
3
3
  return R.isNonNullish(value) && value instanceof Roll;
4
4
  }
5
5
  export function isRolledRoll(value) {
6
- return R.isNonNullish(value) && isRoll(value) && value._evaluated === true;
6
+ return isRoll(value) && value._evaluated === true;
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@7h3laughingman/foundry-helpers",
3
- "version": "13.351.1",
3
+ "version": "13.351.2",
4
4
  "description": "Basic helpers used for developing modules for Foundry VTT",
5
5
  "homepage": "https://github.com/7H3LaughingMan/foundry-helpers#readme",
6
6
  "bugs": {
@@ -15,6 +15,7 @@
15
15
  "type": "module",
16
16
  "exports": {
17
17
  "./lib-wrapper": "./dist/lib-wrapper/index.d.ts",
18
+ "./socketlib": "./dist/socketlib/index.d.ts",
18
19
  "./utilities": "./dist/utilities/index.js"
19
20
  },
20
21
  "files": [
@@ -32,17 +33,17 @@
32
33
  "remeda": "^2.33.6"
33
34
  },
34
35
  "devDependencies": {
35
- "@eslint/js": "^9.39.2",
36
- "@eslint/json": "^0.14.0",
36
+ "@eslint/js": "^10.0.1",
37
+ "@eslint/json": "^1.0.1",
37
38
  "copyfiles": "^2.4.1",
38
- "eslint": "^9.39.2",
39
+ "eslint": "^10.0.0",
39
40
  "eslint-config-prettier": "^10.1.8",
40
41
  "eslint-plugin-prettier": "^5.5.5",
41
42
  "husky": "^9.1.7",
42
43
  "lint-staged": "^16.2.7",
43
44
  "prettier-plugin-organize-imports": "^4.3.0",
44
45
  "typescript": "5.9.3",
45
- "typescript-eslint": "^8.55.0"
46
+ "typescript-eslint": "^8.56.0"
46
47
  },
47
48
  "engines": {
48
49
  "node": ">=24"