@league-of-foundry-developers/foundry-vtt-types 9.238.1 → 9.242.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.
Files changed (95) hide show
  1. package/package.json +1 -1
  2. package/src/foundry/common/constants.mjs.d.ts +1 -0
  3. package/src/foundry/common/data/data.mjs/adventureData.d.ts +21 -21
  4. package/src/foundry/common/data/data.mjs/journalEntryData.d.ts +3 -3
  5. package/src/foundry/common/data/data.mjs/userData.d.ts +10 -3
  6. package/src/foundry/common/documents.mjs/baseCombatant.d.ts +2 -4
  7. package/src/foundry/common/utils/geometry.mjs.d.ts +148 -0
  8. package/src/foundry/common/utils/helpers.mjs.d.ts +37 -37
  9. package/src/foundry/common/utils/module.mjs.d.ts +1 -0
  10. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +1 -1
  11. package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +2 -2
  12. package/src/foundry/foundry.js/audioContainer.d.ts +28 -10
  13. package/src/foundry/foundry.js/canvasAnimation.d.ts +30 -7
  14. package/src/foundry/foundry.js/clientDocuments/cards.d.ts +4 -13
  15. package/src/foundry/foundry.js/clientDocuments/chatMessage.d.ts +2 -2
  16. package/src/foundry/foundry.js/clientDocuments/combat.d.ts +46 -44
  17. package/src/foundry/foundry.js/clientDocuments/combatant.d.ts +14 -17
  18. package/src/foundry/foundry.js/clientDocuments/rollTable.d.ts +2 -2
  19. package/src/foundry/foundry.js/clientKeybindings.d.ts +12 -2
  20. package/src/foundry/foundry.js/clientSettings.d.ts +1 -1
  21. package/src/foundry/foundry.js/collisionResult.d.ts +60 -0
  22. package/src/foundry/foundry.js/config.d.ts +33 -34
  23. package/src/foundry/foundry.js/hooks.d.ts +154 -85
  24. package/src/foundry/foundry.js/imageHelper.d.ts +26 -2
  25. package/src/foundry/foundry.js/keyboardManager.d.ts +2 -2
  26. package/src/foundry/foundry.js/pixi/containers/placeableObject.d.ts +2 -2
  27. package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +2 -2
  28. package/src/foundry/foundry.js/pixi/index.d.ts +1 -0
  29. package/src/foundry/foundry.js/pixi/points/index.d.ts +1 -0
  30. package/src/foundry/foundry.js/pixi/points/wallEndpoint.d.ts +92 -0
  31. package/src/foundry/foundry.js/pixi/polygons/index.d.ts +2 -1
  32. package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygon.d.ts +98 -0
  33. package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygons/clockwiseSweepPolygon.d.ts +388 -0
  34. package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygons/index.d.ts +1 -0
  35. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShader.d.ts +11 -37
  36. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShader.d.ts +114 -0
  37. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveBackgroundShader.d.ts +57 -0
  38. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShader.d.ts +47 -0
  39. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/bewitchingWaveColorationShader.d.ts +6 -0
  40. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/chromaColorationShader.d.ts +6 -0
  41. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/emanationColorationShader.d.ts +6 -0
  42. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/energyFieldColorationShader.d.ts +6 -0
  43. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/fairyLightColorationShader.d.ts +6 -0
  44. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/fogColorationShader.d.ts +6 -0
  45. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/ghostLightColorationShader.d.ts +1 -1
  46. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/hexaDomeColorationShader.d.ts +6 -0
  47. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/index.d.ts +5 -0
  48. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/lightDomeColorationShader.d.ts +6 -0
  49. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/pulseColorationShader.d.ts +1 -1
  50. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/radialRainbowColorationShader.d.ts +6 -0
  51. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/sunburstColorationShader.d.ts +1 -1
  52. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/swirlingRainbowColorationShader.d.ts +6 -0
  53. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/torchColorationShader.d.ts +3 -2
  54. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/vortexColorationShader.d.ts +6 -0
  55. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/waveColorationShader.d.ts +1 -1
  56. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShader.d.ts +63 -0
  57. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShaders/bewitchingWaveIlluminationShader.d.ts +6 -0
  58. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/blackHoleIlluminationShader.d.ts +1 -1
  59. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShaders/fairyLightIlluminationShader.d.ts +6 -0
  60. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/ghostLightIlluminationShader.d.ts +1 -1
  61. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/index.d.ts +3 -0
  62. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/pulseIlluminationShader.d.ts +1 -1
  63. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/roilingIlluminationShader.d.ts +1 -1
  64. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/sunburstIlluminationShader.d.ts +1 -2
  65. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/torchIlluminationShader.d.ts +1 -1
  66. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShaders/vortexIlluminationShader.d.ts +6 -0
  67. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/waveIlluminationShader.d.ts +1 -1
  68. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/index.d.ts +5 -0
  69. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/baseSamplerShader.d.ts +22 -0
  70. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/index.d.ts +3 -4
  71. package/src/foundry/foundry.js/pixi/texts/preciseText.d.ts +10 -2
  72. package/src/foundry/foundry.js/pointSource.d.ts +59 -328
  73. package/src/foundry/foundry.js/pointSources/index.d.ts +3 -0
  74. package/src/foundry/foundry.js/pointSources/lightSource.d.ts +417 -0
  75. package/src/foundry/foundry.js/pointSources/soundSource.d.ts +46 -0
  76. package/src/foundry/foundry.js/pointSources/visionSource.d.ts +125 -0
  77. package/src/foundry/foundry.js/polygonEdge.d.ts +26 -0
  78. package/src/foundry/foundry.js/polygonVertex.d.ts +89 -0
  79. package/src/foundry/foundry.js/quadtreeCulling.d.ts +11 -0
  80. package/src/foundry/foundry.js/ray.d.ts +156 -162
  81. package/src/foundry/foundry.js/rays/index.d.ts +1 -0
  82. package/src/foundry/foundry.js/rays/sightRay.d.ts +34 -0
  83. package/src/foundry/foundry.js/roll.d.ts +27 -32
  84. package/src/foundry/foundry.js/screenCulling.d.ts +19 -0
  85. package/src/foundry/foundry.js/specialEffect.d.ts +1 -1
  86. package/src/foundry/index.d.ts +26 -27
  87. package/src/foundry/foundry.js/pixi/polygons/sourcePolygon.d.ts +0 -25
  88. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShader.d.ts +0 -21
  89. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/chromaColorationShader.d.ts +0 -18
  90. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/emanationColorationShader.d.ts +0 -17
  91. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/energyFieldColorationShader.d.ts +0 -18
  92. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/fogColorationShader.d.ts +0 -17
  93. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/hexaDomeColorationShader.d.ts +0 -17
  94. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/lightDomeColorationShader.d.ts +0 -17
  95. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardIlluminationShader.d.ts +0 -22
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@league-of-foundry-developers/foundry-vtt-types",
3
- "version": "9.238.1",
3
+ "version": "9.242.0",
4
4
  "description": "TypeScript type definitions for Foundry VTT",
5
5
  "exports": {
6
6
  ".": {
@@ -721,6 +721,7 @@ export type WALL_DOOR_STATES = ValueOf<typeof WALL_DOOR_STATES>;
721
721
  * The wall properties which restrict the way interaction occurs with a specific wall
722
722
  */
723
723
  export const WALL_RESTRICTION_TYPES: readonly ['light', 'sight', 'sound', 'move'];
724
+ export type WALL_RESTRICTION_TYPES = ValueOf<typeof WALL_RESTRICTION_TYPES>;
724
725
 
725
726
  /**
726
727
  * The types of sensory collision which a Wall may impose
@@ -2,16 +2,16 @@ import type { PropertiesToSource } from '../../../../types/helperTypes.js';
2
2
  import type DocumentData from '../../abstract/data.mjs';
3
3
  import { AnyDocumentData } from '../../abstract/data.mjs';
4
4
  import * as fields from '../fields.mjs';
5
- import type { ActorData } from './actorData.js';
6
- import type { CardsData } from './cardsData.js';
7
- import type { CombatData } from './combatData.js';
8
- import type { FolderData } from './folderData.js';
9
- import type { ItemData } from './itemData.js';
10
- import type { JournalEntryData } from './journalEntryData.js';
11
- import type { MacroData } from './macroData.js';
12
- import type { PlaylistData } from './playlistData.js';
13
- import type { RollTableData } from './rollTableData.js';
14
- import type { SceneData } from './sceneData.js';
5
+ import type { ActorData, ActorDataConstructorData } from './actorData.js';
6
+ import type { CardsData, CardsDataConstructorData } from './cardsData.js';
7
+ import type { CombatData, CombatDataConstructorData } from './combatData.js';
8
+ import type { FolderData, FolderDataConstructorData } from './folderData.js';
9
+ import type { ItemData, ItemDataConstructorData } from './itemData.js';
10
+ import type { JournalEntryData, JournalEntryDataConstructorData } from './journalEntryData.js';
11
+ import type { MacroData, MacroDataConstructorData } from './macroData.js';
12
+ import type { PlaylistData, PlaylistDataConstructorData } from './playlistData.js';
13
+ import type { RollTableData, RollTableDataConstructorData } from './rollTableData.js';
14
+ import type { SceneData, SceneDataConstructorData } from './sceneData.js';
15
15
 
16
16
  interface AdventureDataSchema extends DocumentSchema {
17
17
  _id: fields.DocumentId;
@@ -92,34 +92,34 @@ interface AdventureDataConstructorData {
92
92
  description?: string | null | undefined;
93
93
 
94
94
  /** @defaultValue `[]` */
95
- actors?: ActorData[] | null | undefined;
95
+ actors?: ActorDataConstructorData[] | null | undefined;
96
96
 
97
97
  /** @defaultValue `[]` */
98
- combats?: CombatData[] | null | undefined;
98
+ combats?: CombatDataConstructorData[] | null | undefined;
99
99
 
100
100
  /** @defaultValue `[]` */
101
- items?: ItemData[] | null | undefined;
101
+ items?: ItemDataConstructorData[] | null | undefined;
102
102
 
103
103
  /** @defaultValue `[]` */
104
- scenes?: SceneData[] | null | undefined;
104
+ scenes?: SceneDataConstructorData[] | null | undefined;
105
105
 
106
106
  /** @defaultValue `[]` */
107
- journal?: JournalEntryData[] | null | undefined;
107
+ journal?: JournalEntryDataConstructorData[] | null | undefined;
108
108
 
109
109
  /** @defaultValue `[]` */
110
- tables?: RollTableData[] | null | undefined;
110
+ tables?: RollTableDataConstructorData[] | null | undefined;
111
111
 
112
112
  /** @defaultValue `[]` */
113
- macros?: MacroData[] | null | undefined;
113
+ macros?: MacroDataConstructorData[] | null | undefined;
114
114
 
115
115
  /** @defaultValue `[]` */
116
- cards?: CardsData[] | null | undefined;
116
+ cards?: CardsDataConstructorData[] | null | undefined;
117
117
 
118
118
  /** @defaultValue `[]` */
119
- playlists?: PlaylistData[] | null | undefined;
119
+ playlists?: PlaylistDataConstructorData[] | null | undefined;
120
120
 
121
121
  /** @defaultValue `[]` */
122
- folders?: FolderData[] | null | undefined;
122
+ folders?: FolderDataConstructorData[] | null | undefined;
123
123
 
124
124
  /** @defaultValue `0` */
125
125
  sort?: number | null | undefined;
@@ -155,7 +155,7 @@ export class AdventureData extends DocumentData<
155
155
 
156
156
  /**
157
157
  * Property type: `D[]`
158
- * Constructor type: `D[] | null | undefined`
158
+ * Constructor type: `ConstructorDataType<D>[] | null | undefined`
159
159
  * Default: `[]`
160
160
  */
161
161
  type AdventureDocumentsField<D extends ConstructorOf<AnyDocumentData>> = DocumentField<D> & {
@@ -62,7 +62,7 @@ interface JournalEntryDataProperties {
62
62
  flags: ConfiguredFlags<'JournalEntry'>;
63
63
  }
64
64
 
65
- interface JournalEntryConstructorData {
65
+ interface JournalEntryDataConstructorData {
66
66
  /**
67
67
  * The _id which uniquely identifies this JournalEntry document
68
68
  * @defaultValue `null`
@@ -118,10 +118,10 @@ export class JournalEntryData extends DocumentData<
118
118
  JournalEntryDataSchema,
119
119
  JournalEntryDataProperties,
120
120
  PropertiesToSource<JournalEntryDataProperties>,
121
- JournalEntryConstructorData,
121
+ JournalEntryDataConstructorData,
122
122
  documents.BaseJournalEntry
123
123
  > {
124
- constructor(data: JournalEntryConstructorData, document?: documents.BaseJournalEntry | null);
124
+ constructor(data: JournalEntryDataConstructorData, document?: documents.BaseJournalEntry | null);
125
125
 
126
126
  /** @override */
127
127
  static defineSchema(): JournalEntryDataSchema;
@@ -63,9 +63,13 @@ interface UserDataProperties {
63
63
  /** The user's name. */
64
64
  name: string;
65
65
 
66
- /** @defaultValue `""` */
66
+ /**
67
+ * The user's password. Available only on the Server side for security.
68
+ * @defaultValue `""`
69
+ */
67
70
  password: string;
68
71
 
72
+ /** The user's password salt. Available only on the Server side for security. */
69
73
  passwordSalt: string | undefined;
70
74
 
71
75
  /**
@@ -113,9 +117,12 @@ interface UserDataConstructorData {
113
117
  /** The user's name. */
114
118
  name: string;
115
119
 
116
- /** @defaultValue `""` */
117
- password?: string | null | undefined;
120
+ /**
121
+ * The user's password. Available only on the Server side for security.
122
+ * @defaultValue `""`
123
+ */ password?: string | null | undefined;
118
124
 
125
+ /** The user's password salt. Available only on the Server side for security. */
119
126
  passwordSalt?: string | null | undefined;
120
127
 
121
128
  /**
@@ -26,7 +26,7 @@ export declare class BaseCombatant extends Document<
26
26
  isEmbedded: true;
27
27
  labelPlural: 'DOCUMENT.Combatants';
28
28
  permissions: {
29
- create: 'PLAYER';
29
+ create: typeof BaseCombatant._canCreate;
30
30
  update: typeof BaseCombatant._canUpdate;
31
31
  };
32
32
  }
@@ -38,8 +38,6 @@ export declare class BaseCombatant extends Document<
38
38
  */
39
39
  protected static _canUpdate(user: BaseUser, doc: BaseCombatant, data?: CombatantDataConstructorData): boolean;
40
40
 
41
- /**
42
- * Is a user able to create this Combatant?
43
- */
41
+ /** Is a user able to create this Combatant? */
44
42
  protected static _canCreate(user: BaseUser, doc: BaseCombatant, data?: CombatantDataConstructorData): boolean;
45
43
  }
@@ -0,0 +1,148 @@
1
+ /**
2
+ * Determine the relative orientation of three points in two-dimensional space.
3
+ * The result is also an approximation of twice the signed area of the triangle defined by the three points.
4
+ * This method is fast - but not robust against issues of floating point precision. Best used with integer coordinates.
5
+ * Adapted from https://github.com/mourner/robust-predicates
6
+ *
7
+ * @param a - An endpoint of segment AB, relative to which point C is tested
8
+ * @param b - An endpoint of segment AB, relative to which point C is tested
9
+ * @param c - A point that is tested relative to segment AB
10
+ *
11
+ * @returns The relative orientation of points A, B, and C
12
+ * A positive value if the points are in counter-clockwise order (C lies to the left of AB)
13
+ * A negative value if the points are in clockwise order (C lies to the right of AB)
14
+ * Zero if the points A, B, and C are collinear.
15
+ */
16
+ export function orient2dFast(a: Point, b: Point, c: Point): number;
17
+
18
+ /**
19
+ * Quickly test whether the line segment AB intersects with the line segment CD.
20
+ * This method does not determine the point of intersection, for that use lineLineIntersection
21
+ *
22
+ * @param a - The first endpoint of segment AB
23
+ * @param b - The second endpoint of segment AB
24
+ * @param c - The first endpoint of segment CD
25
+ * @param d - The second endpoint of segment CD
26
+ *
27
+ * @returns Do the line segments intersect?
28
+ */
29
+ export function lineSegmentIntersects(a: Point, b: Point, c: Point, d: Point): boolean;
30
+
31
+ interface LineIntersection {
32
+ /** The x-coordinate of intersection */
33
+ x: number;
34
+
35
+ /** The y-coordinate of intersection */
36
+ y: number;
37
+
38
+ /** The vector distance from A to B on segment AB */
39
+ t0: number;
40
+
41
+ /** The vector distance from C to D on segment CD */
42
+ t1?: number;
43
+ }
44
+
45
+ /**
46
+ * An internal helper method for computing the intersection between two infinite-length lines.
47
+ * Adapted from http://paulbourke.net/geometry/pointlineplane/
48
+ *
49
+ * @param a - The first endpoint of segment AB
50
+ * @param b - The second endpoint of segment AB
51
+ * @param c - The first endpoint of segment CD
52
+ * @param d - The second endpoint of segment CD
53
+ *
54
+ * @returns An intersection point, or null if no intersection occurred
55
+ */
56
+ export function lineLineIntersection(a: Point, b: Point, c: Point, d: Point): LineIntersection | null;
57
+
58
+ /**
59
+ * An internal helper method for computing the intersection between two finite line segments.
60
+ * Adapted from http://paulbourke.net/geometry/pointlineplane/
61
+ *
62
+ * @param a - The first endpoint of segment AB
63
+ * @param b - The second endpoint of segment AB
64
+ * @param c - The first endpoint of segment CD
65
+ * @param d - The second endpoint of segment CD
66
+ * @param epsilon - A small epsilon which defines a tolerance for near-equality
67
+ * (default: `1e-8`)
68
+ *
69
+ * @returns An intersection point, or null if no intersection occurred
70
+ */
71
+ export function lineSegmentIntersection(
72
+ a: Point,
73
+ b: Point,
74
+ c: Point,
75
+ d: Point,
76
+ epsilon?: number
77
+ ): LineIntersection | null;
78
+
79
+ interface LineCircleIntersection {
80
+ /** Is point A inside the circle? */
81
+ aInside: boolean;
82
+
83
+ /** Is point B inside the circle? */
84
+ bInside: boolean;
85
+
86
+ /** Is the segment AB contained within the circle? */
87
+ contained: boolean;
88
+
89
+ /** Is the segment AB fully outside the circle? */
90
+ outside: boolean;
91
+
92
+ /** Is the segment AB tangent to the circle? */
93
+ tangent: boolean;
94
+
95
+ /** Intersection points: zero, one, or two */
96
+ intersections: [number] | [number, number] | [number, number, number];
97
+ }
98
+
99
+ /**
100
+ * Determine the intersection between a candidate wall and the circular radius of the polygon.
101
+ *
102
+ * @param a - The initial vertex of the candidate edge
103
+ * @param b - The second vertex of the candidate edge
104
+ * @param center - The center of the bounding circle
105
+ * @param radius - The radius of the bounding circle
106
+ * @param epsilon - A small tolerance for floating point precision
107
+ * (default: `1e-8`)
108
+ *
109
+ * @returns The intersection of the segment AB with the circle
110
+ */
111
+ export function lineCircleIntersection(
112
+ a: Point,
113
+ b: Point,
114
+ center: Point,
115
+ radius: number,
116
+ epsilon?: number
117
+ ): LineCircleIntersection;
118
+
119
+ /**
120
+ * Identify the point closest to C on segment AB
121
+ *
122
+ * @param c - The reference point C
123
+ * @param a - Point A on segment AB
124
+ * @param b - Point B on segment AB
125
+ *
126
+ * @returns The closest point to C on segment AB
127
+ */
128
+ export function closestPointToSegment(c: Point, a: Point, b: Point): Point;
129
+
130
+ /**
131
+ * Determine the points of intersection between a line segment (p0,p1) and a circle.
132
+ * There will be zero, one, or two intersections
133
+ * See https://math.stackexchange.com/a/311956
134
+ *
135
+ * @param p0 - The initial point of the line segment
136
+ * @param p1 - The terminal point of the line segment
137
+ * @param center - The center of the circle
138
+ * @param radius - The radius of the circle
139
+ * @param epsilon - A small tolerance for floating point precision
140
+ * (default: `0`)
141
+ */
142
+ export function quadraticIntersection(
143
+ p0: Point,
144
+ p1: Point,
145
+ center: Point,
146
+ radius: number,
147
+ epsilon?: number
148
+ ): { x: number; y: number }[];
@@ -258,43 +258,6 @@ export declare function isNewerVersion(v1: number | string, v0: number | string)
258
258
  */
259
259
  export declare function isObjectEmpty(obj: object): boolean;
260
260
 
261
- /**
262
- * Update a source object by replacing its keys and values with those from a target object.
263
- *
264
- * @param original - The initial object which should be updated with values from the target
265
- * @param other - A new object whose values should replace those in the source
266
- * (default: `{}`)
267
- * @param options - Additional options which configure the merge
268
- * (default: `{}`)
269
- * @param _d - A privately used parameter to track recursion depth.
270
- * (default: `0`)
271
- * @returns The original source object including updated, inserted, or overwritten records.
272
- *
273
- * @example <caption>Control how new keys and values are added</caption>
274
- * ```typescript
275
- * mergeObject({k1: "v1"}, {k2: "v2"}, {insertKeys: false}); // {k1: "v1"}
276
- * mergeObject({k1: "v1"}, {k2: "v2"}, {insertKeys: true}); // {k1: "v1", k2: "v2"}
277
- * mergeObject({k1: {i1: "v1"}}, {k1: {i2: "v2"}}, {insertValues: false}); // {k1: {i1: "v1"}}
278
- * mergeObject({k1: {i1: "v1"}}, {k1: {i2: "v2"}}, {insertValues: true}); // {k1: {i1: "v1", i2: "v2"}}
279
- * ```
280
- *
281
- * @example <caption>Control how existing data is overwritten</caption>
282
- * ```typescript
283
- * mergeObject({k1: "v1"}, {k1: "v2"}, {overwrite: true}); // {k1: "v2"}
284
- * mergeObject({k1: "v1"}, {k1: "v2"}, {overwrite: false}); // {k1: "v1"}
285
- * ```
286
- *
287
- * @example <caption>Control whether merges are performed recursively</caption>
288
- * ```typescript
289
- * mergeObject({k1: {i1: "v1"}}, {k1: {i2: "v2"}}, {recursive: false}); // {k1: {i1: "v2"}}
290
- * mergeObject({k1: {i1: "v1"}}, {k1: {i2: "v2"}}, {recursive: true}); // {k1: {i1: "v1", i2: "v2"}}
291
- * ```
292
- *
293
- * @example <caption>Deleting an existing object key</caption>
294
- * ```typescript
295
- * mergeObject({k1: "v1", k2: "v2"}, {"-=k1": null}); // {k2: "v2"}
296
- * ```
297
- */
298
261
  type OmitByValue<T, ValueType> = { [Key in keyof T as T[Key] extends ValueType ? never : Key]: T[Key] };
299
262
  type RemoveNever<T> = OmitByValue<T, never>;
300
263
  type PropWithMinus<K> = K extends string ? `-=${K}` : never;
@@ -333,6 +296,43 @@ type WithWidenedArrayTypes<T> = T extends Array<any>
333
296
  ? { [K in keyof T]: WithWidenedArrayTypes<T[K]> }
334
297
  : T;
335
298
 
299
+ /**
300
+ * Update a source object by replacing its keys and values with those from a target object.
301
+ *
302
+ * @param original - The initial object which should be updated with values from the target
303
+ * @param other - A new object whose values should replace those in the source
304
+ * (default: `{}`)
305
+ * @param options - Additional options which configure the merge
306
+ * (default: `{}`)
307
+ * @param _d - A privately used parameter to track recursion depth.
308
+ * (default: `0`)
309
+ * @returns The original source object including updated, inserted, or overwritten records.
310
+ *
311
+ * @example <caption>Control how new keys and values are added</caption>
312
+ * ```typescript
313
+ * mergeObject({k1: "v1"}, {k2: "v2"}, {insertKeys: false}); // {k1: "v1"}
314
+ * mergeObject({k1: "v1"}, {k2: "v2"}, {insertKeys: true}); // {k1: "v1", k2: "v2"}
315
+ * mergeObject({k1: {i1: "v1"}}, {k1: {i2: "v2"}}, {insertValues: false}); // {k1: {i1: "v1"}}
316
+ * mergeObject({k1: {i1: "v1"}}, {k1: {i2: "v2"}}, {insertValues: true}); // {k1: {i1: "v1", i2: "v2"}}
317
+ * ```
318
+ *
319
+ * @example <caption>Control how existing data is overwritten</caption>
320
+ * ```typescript
321
+ * mergeObject({k1: "v1"}, {k1: "v2"}, {overwrite: true}); // {k1: "v2"}
322
+ * mergeObject({k1: "v1"}, {k1: "v2"}, {overwrite: false}); // {k1: "v1"}
323
+ * ```
324
+ *
325
+ * @example <caption>Control whether merges are performed recursively</caption>
326
+ * ```typescript
327
+ * mergeObject({k1: {i1: "v1"}}, {k1: {i2: "v2"}}, {recursive: false}); // {k1: {i1: "v2"}}
328
+ * mergeObject({k1: {i1: "v1"}}, {k1: {i2: "v2"}}, {recursive: true}); // {k1: {i1: "v1", i2: "v2"}}
329
+ * ```
330
+ *
331
+ * @example <caption>Deleting an existing object key</caption>
332
+ * ```typescript
333
+ * mergeObject({k1: "v1", k2: "v2"}, {"-=k1": null}); // {k2: "v2"}
334
+ * ```
335
+ */
336
336
  export declare function mergeObject<
337
337
  T extends object,
338
338
  U extends DeepPartial<WithWidenedArrayTypes<T>>,
@@ -1,3 +1,4 @@
1
+ export * from './geometry.mjs';
1
2
  export * from './helpers.mjs';
2
3
  export { default as Collection } from './collection.mjs';
3
4
  export { default as Semaphore } from './semaphore.mjs';
@@ -74,7 +74,7 @@ declare global {
74
74
  interface Data<Options extends DocumentSheet.Options>
75
75
  extends DocumentSheet.Data<InstanceType<ConfiguredDocumentClassForName<'AmbientLight'>>, Options> {
76
76
  isAdvanced: boolean;
77
- colorationTechniques: unknown; // FIXME: typeof AdaptiveLightingShader.COLORATION_TECHNIQUES
77
+ colorationTechniques: typeof AdaptiveLightingShader.COLORATION_TECHNIQUES;
78
78
  lightAnimations: Record<string, string> & {
79
79
  '': 'None';
80
80
  };
@@ -276,7 +276,7 @@ declare global {
276
276
  * @param mode - The new roll mode setting
277
277
  * @internal
278
278
  */
279
- protected static _setRollMode(mode: foundry.CONST.DICE_ROLL_MODES): void;
279
+ protected static _setRollMode(mode: keyof CONFIG.Dice.RollModes): void;
280
280
  }
281
281
 
282
282
  namespace ChatLog {
@@ -297,7 +297,7 @@ declare global {
297
297
 
298
298
  interface Data {
299
299
  user: InstanceType<ConfiguredDocumentClass<typeof User>>;
300
- rollMode: foundry.CONST.DICE_ROLL_MODES;
300
+ rollMode: keyof CONFIG.Dice.RollModes;
301
301
  rollModes: typeof CONFIG['Dice']['rollModes'];
302
302
  isStream: boolean;
303
303
  }
@@ -2,7 +2,6 @@
2
2
  * An AudioSourceNode container which handles the strategy of node type to use for playback.
3
3
  * Used by the Sound interface which controls playback.
4
4
  * This class is for internal use only and should not be used by external callers.
5
- * @internal
6
5
  */
7
6
  declare class AudioContainer {
8
7
  constructor(src: string);
@@ -31,16 +30,11 @@ declare class AudioContainer {
31
30
  isBuffer: boolean;
32
31
 
33
32
  /**
34
- * Has the source for this audio container been loaded to a point that playback can begin?
35
- * @defaultValue `false`
36
- */
37
- loaded: boolean;
38
-
39
- /**
40
- * Did the audio source fail to load (a 404 or some other reason).
41
- * @defaultValue `false`
33
+ * Whether we have attempted to load the audio node or not, and whether it failed.
34
+ * @see {@link LOAD_STATES}
35
+ * @defaultValue `AudioContainer.LOAD_STATES.NONE`
42
36
  */
43
- failed: boolean;
37
+ loadState: AudioContainer.LOAD_STATES;
44
38
 
45
39
  /**
46
40
  * Is the audio source currently playing?
@@ -65,6 +59,26 @@ declare class AudioContainer {
65
59
  */
66
60
  static MAX_BUFFER_DURATION: number;
67
61
 
62
+ /**
63
+ * The sequence of container loading states.
64
+ */
65
+ static LOAD_STATES: {
66
+ FAILED: -1;
67
+ NONE: 0;
68
+ LOADING: 1;
69
+ LOADED: 2;
70
+ };
71
+
72
+ /**
73
+ * Has the audio file been loaded either fully or for streaming.
74
+ */
75
+ get loaded(): boolean;
76
+
77
+ /**
78
+ * Did the audio file fail to load.
79
+ */
80
+ get failed(): boolean;
81
+
68
82
  /**
69
83
  * A reference to the AudioBuffer if the sourceNode is a AudioBufferSourceNode.
70
84
  */
@@ -155,3 +169,7 @@ declare class AudioContainer {
155
169
  */
156
170
  protected _unloadMediaNode(): void;
157
171
  }
172
+
173
+ declare namespace AudioContainer {
174
+ type LOAD_STATES = ValueOf<typeof AudioContainer['LOAD_STATES']>;
175
+ }
@@ -1,3 +1,17 @@
1
+ interface CanvasAnimationData {
2
+ /** The animation function being executed each frame */
3
+ fn: (dt: number) => void;
4
+
5
+ /** The object context within which animation occurs */
6
+ context: PIXI.DisplayObject;
7
+
8
+ /** A Promise which resolves once the animation is complete */
9
+ promise: Promise<boolean>;
10
+
11
+ /** The resolution function, allowing animation to be ended early */
12
+ resolve: (value: boolean) => void;
13
+ }
14
+
1
15
  /**
2
16
  * A helper class providing utility methods for PIXI Canvas animation
3
17
  */
@@ -8,9 +22,7 @@ declare class CanvasAnimation {
8
22
  * Track an object of active animations by name, context, and function
9
23
  * This allows a currently playing animation to be referenced and terminated
10
24
  */
11
- static animations: Partial<
12
- Record<string, { fn: (dt: number) => void; context: PIXI.Container; resolve: (value: boolean) => void }>
13
- >;
25
+ static animations: Record<string, CanvasAnimationData>;
14
26
 
15
27
  /**
16
28
  * Apply a linear animation from the current value of some attribute to a new value
@@ -42,6 +54,13 @@ declare class CanvasAnimation {
42
54
  options?: InexactPartial<LinearAnimationOptions>
43
55
  ): Promise<boolean>;
44
56
 
57
+ /**
58
+ * Retrieve an animation currently in progress by its name
59
+ * @param name - The animation name to retrieve
60
+ * @returns The animation data, or undefined
61
+ */
62
+ static getAnimation(name: string): CanvasAnimationData | undefined;
63
+
45
64
  /**
46
65
  * If an animation using a certain name already exists, terminate it
47
66
  * @param name - The animation name to terminate
@@ -75,7 +94,7 @@ declare class CanvasAnimation {
75
94
  */
76
95
  protected static _animateFrame(
77
96
  deltaTime: number,
78
- resolve: (value: boolean) => void,
97
+ resolve: CanvasAnimationData['resolve'],
79
98
  reject: (reason?: any) => void,
80
99
  attributes: CanvasAnimation.Attribute[],
81
100
  duration: number,
@@ -85,8 +104,12 @@ declare class CanvasAnimation {
85
104
 
86
105
  declare namespace CanvasAnimation {
87
106
  interface Attribute {
88
- parent: any;
89
107
  attribute: string;
108
+ d?: number;
109
+ delta?: number;
110
+ done?: number;
111
+ parent: any;
112
+ remaining?: number;
90
113
  to: number;
91
114
  }
92
115
  }
@@ -95,7 +118,7 @@ interface LinearAnimationOptions {
95
118
  /**
96
119
  * An animation context to use which defines scope
97
120
  */
98
- context: PIXI.Container;
121
+ context: PIXI.DisplayObject;
99
122
 
100
123
  /**
101
124
  * Provide a unique animation name which may be referenced later
@@ -117,7 +140,7 @@ interface LinearAnimationOptions {
117
140
  type TickFunction = (dt: number, attributes: CanvasAnimation.Attribute[]) => void;
118
141
  type TransitionFunction = (
119
142
  dt: number,
120
- resolve: (value: boolean) => void,
143
+ resolve: CanvasAnimationData['resolve'],
121
144
  reject: (reason?: any) => void,
122
145
  attributes: CanvasAnimation.Attribute[],
123
146
  duration: number,
@@ -99,11 +99,8 @@ declare global {
99
99
  * Shuffle this Cards stack, randomizing the sort order of all the cards it contains.
100
100
  * @param options - (default: `{}`)
101
101
  * @returns The Cards document after the shuffle operation has completed
102
- * @remarks The returns documentaion is incorrect (https://gitlab.com/foundrynet/foundryvtt/-/issues/6367).
103
102
  */
104
- shuffle(
105
- options?: Cards.ShuffleOptions | undefined
106
- ): Promise<InstanceType<ConfiguredDocumentClassForName<'Card'>>[]>;
103
+ shuffle(options?: Cards.ShuffleOptions | undefined): Promise<InstanceType<ConfiguredDocumentClassForName<'Cards'>>>;
107
104
 
108
105
  /**
109
106
  * Reset the Cards stack, retrieving all original cards from other stacks where they may have been drawn if this is a
@@ -111,13 +108,8 @@ declare global {
111
108
  * @param options - Options which modify the reset operation
112
109
  * (default: `{}`)
113
110
  * @returns The Cards document after the reset operation has completed
114
- * @remarks The returns documentaion is incorrect (https://gitlab.com/foundrynet/foundryvtt/-/issues/6367).
115
111
  */
116
- reset(
117
- options?: Cards.ResetOptions | undefined
118
- ): Promise<
119
- InstanceType<ConfiguredDocumentClassForName<'Card'>>[] | InstanceType<ConfiguredDocumentClassForName<'Cards'>>
120
- >;
112
+ reset(options?: Cards.ResetOptions | undefined): Promise<InstanceType<ConfiguredDocumentClassForName<'Cards'>>>;
121
113
 
122
114
  /**
123
115
  * Perform a reset operation for a deck, retrieving all original cards from other stacks where they may have been
@@ -126,11 +118,10 @@ declare global {
126
118
  * (default: `{}`)
127
119
  * @returns The Cards document after the reset operation has completed.
128
120
  * @internal
129
- * @remarks The returns documentaion is incorrect (https://gitlab.com/foundrynet/foundryvtt/-/issues/6367).
130
121
  */
131
122
  protected _resetDeck(
132
123
  options?: Cards.ResetOptions | undefined
133
- ): Promise<InstanceType<ConfiguredDocumentClassForName<'Card'>>[]>;
124
+ ): Promise<InstanceType<ConfiguredDocumentClassForName<'Cards'>>>;
134
125
 
135
126
  /**
136
127
  * Return all cards in this stack to their original decks.
@@ -220,7 +211,7 @@ declare global {
220
211
  * Display a dialog which prompts the user to play a specific Card to some other Cards document
221
212
  * @see {@link Cards#pass}
222
213
  * @param card - The specific card being played as part of this dialog
223
- * @remarks returns documentation is incorrect.
214
+ * @remarks returns documentation is incorrect (see https://gitlab.com/foundrynet/foundryvtt/-/issues/6367)
224
215
  */
225
216
  playDialog(
226
217
  card: InstanceType<ConfiguredDocumentClassForName<'Card'>>
@@ -74,14 +74,14 @@ declare global {
74
74
  */
75
75
  static applyRollMode(
76
76
  chatData: ChatMessageDataConstructorData,
77
- rollMode: foundry.CONST.DICE_ROLL_MODES
77
+ rollMode: keyof typeof CONFIG.Dice.rollModes | 'roll'
78
78
  ): ChatMessageDataConstructorData;
79
79
 
80
80
  /**
81
81
  * Update the data of a ChatMessage instance to apply a requested rollMode
82
82
  * @param rollMode - The rollMode preference to apply to this message data
83
83
  */
84
- applyRollMode(rollMode: foundry.CONST.DICE_ROLL_MODES): void;
84
+ applyRollMode(rollMode: keyof typeof CONFIG.Dice.rollModes | 'roll'): void;
85
85
 
86
86
  /**
87
87
  * Attempt to determine who is the speaking character (and token) for a certain Chat Message