@7h3laughingman/pf2e-helpers 7.10.1 → 7.10.3
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/socketlib/index.d.ts +1 -0
- package/dist/utilities/check.d.ts +2 -0
- package/dist/utilities/check.js +4 -0
- package/dist/utilities/index.d.ts +6 -1
- package/dist/utilities/roll.d.ts +8 -0
- package/dist/utilities/roll.js +21 -0
- package/dist/utilities/system.d.ts +1 -1
- package/package.json +6 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@7h3laughingman/foundry-helpers/socketlib";
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { ActorPF2e, UserPF2e } from "@7h3laughingman/pf2e-types";
|
|
1
|
+
import { ActorPF2e, ItemPF2e, MacroPF2e, ScenePF2e, UserPF2e } from "@7h3laughingman/pf2e-types";
|
|
2
|
+
import CompendiumCollection = foundry.documents.collections.CompendiumCollection;
|
|
2
3
|
declare module "@7h3laughingman/foundry-helpers/utilities" {
|
|
4
|
+
function isCompendiumPack<T extends ActorPF2e<null>>(pack: unknown, type: "Actor"): pack is CompendiumCollection<T>;
|
|
5
|
+
function isCompendiumPack<T extends ItemPF2e<null>>(pack: unknown, type: "Item"): pack is CompendiumCollection<T>;
|
|
6
|
+
function isCompendiumPack<T extends MacroPF2e>(pack: unknown, type: "Macro"): pack is CompendiumCollection<T>;
|
|
7
|
+
function isCompendiumPack<T extends ScenePF2e>(pack: unknown, type: "Scene"): pack is CompendiumCollection<T>;
|
|
3
8
|
function getCurrentUser(): UserPF2e;
|
|
4
9
|
function userIsGM(user?: UserPF2e): boolean;
|
|
5
10
|
function getPrimaryUpdater(actor: ActorPF2e): UserPF2e | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Rolled } from "@7h3laughingman/foundry-types/client/dice/roll.mjs";
|
|
2
|
+
import { CheckRoll, DamageInstance, DamageRoll } from "@7h3laughingman/pf2e-types";
|
|
3
|
+
export declare function isDamageRoll(value: unknown): value is DamageRoll;
|
|
4
|
+
export declare function isRolledDamageRoll(value: unknown): value is Rolled<DamageRoll>;
|
|
5
|
+
export declare function isDamageInstance(value: unknown): value is DamageInstance;
|
|
6
|
+
export declare function isRolledDamageInstance(value: unknown): value is Rolled<DamageInstance>;
|
|
7
|
+
export declare function isCheckRoll(value: unknown): value is CheckRoll;
|
|
8
|
+
export declare function isRolledCheckRoll(Value: unknown): Value is Rolled<CheckRoll>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { getDamageRollClass } from "./damage.js";
|
|
2
|
+
import * as R from "remeda";
|
|
3
|
+
import { getCheckRollClass } from "./check.js";
|
|
4
|
+
export function isDamageRoll(value) {
|
|
5
|
+
return R.isNonNullish(value) && value instanceof getDamageRollClass();
|
|
6
|
+
}
|
|
7
|
+
export function isRolledDamageRoll(value) {
|
|
8
|
+
return isDamageRoll(value) && value._evaluated === true;
|
|
9
|
+
}
|
|
10
|
+
export function isDamageInstance(value) {
|
|
11
|
+
return R.isNonNullish(value) && value instanceof getDamageRollClass();
|
|
12
|
+
}
|
|
13
|
+
export function isRolledDamageInstance(value) {
|
|
14
|
+
return isDamageInstance(value) && value._evaluated === true;
|
|
15
|
+
}
|
|
16
|
+
export function isCheckRoll(value) {
|
|
17
|
+
return R.isNonNullish(value) && value instanceof getCheckRollClass();
|
|
18
|
+
}
|
|
19
|
+
export function isRolledCheckRoll(Value) {
|
|
20
|
+
return isCheckRoll(Value) && Value._evaluated === true;
|
|
21
|
+
}
|
|
@@ -3,7 +3,7 @@ export declare class SYSTEM {
|
|
|
3
3
|
static get id(): SystemId;
|
|
4
4
|
static get isPF2e(): boolean;
|
|
5
5
|
static get isSF2e(): boolean;
|
|
6
|
-
static path<T extends string>(tail: T): `systems/${
|
|
6
|
+
static path<T extends string>(tail: T): `systems/${SystemId}/${T}`;
|
|
7
7
|
static path(...path: string[]): string;
|
|
8
8
|
static uuid<P extends DocumentUUID, S extends DocumentUUID>(pf2e: P, sf2e: S): P | S;
|
|
9
9
|
static sluggify(text: string, { camel }?: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@7h3laughingman/pf2e-helpers",
|
|
3
|
-
"version": "7.10.
|
|
3
|
+
"version": "7.10.3",
|
|
4
4
|
"description": "Basic helpers used for developed modules for the PF2e/SF2e system.",
|
|
5
5
|
"homepage": "https://github.com/7H3LaughingMan/pf2e-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": [
|
|
@@ -34,17 +35,17 @@
|
|
|
34
35
|
"remeda": "^2.33.6"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
|
-
"@eslint/js": "^
|
|
38
|
-
"@eslint/json": "^0.
|
|
38
|
+
"@eslint/js": "^10.0.1",
|
|
39
|
+
"@eslint/json": "^1.0.1",
|
|
39
40
|
"copyfiles": "^2.4.1",
|
|
40
|
-
"eslint": "^
|
|
41
|
+
"eslint": "^10.0.0",
|
|
41
42
|
"eslint-config-prettier": "^10.1.8",
|
|
42
43
|
"eslint-plugin-prettier": "^5.5.5",
|
|
43
44
|
"husky": "^9.1.7",
|
|
44
45
|
"lint-staged": "^16.2.7",
|
|
45
46
|
"prettier-plugin-organize-imports": "^4.3.0",
|
|
46
47
|
"typescript": "5.9.3",
|
|
47
|
-
"typescript-eslint": "^8.
|
|
48
|
+
"typescript-eslint": "^8.56.0"
|
|
48
49
|
},
|
|
49
50
|
"engines": {
|
|
50
51
|
"node": ">=24"
|