@league-of-foundry-developers/foundry-vtt-types 9.269.1 → 9.280.1

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": "@league-of-foundry-developers/foundry-vtt-types",
3
- "version": "9.269.1",
3
+ "version": "9.280.1",
4
4
  "description": "TypeScript type definitions for Foundry VTT",
5
5
  "exports": {
6
6
  ".": {
@@ -42,6 +42,12 @@ declare global {
42
42
  */
43
43
  hud: HeadsUpDisplay | null;
44
44
 
45
+ /**
46
+ * Position of the mouse on stage.
47
+ * @type {PIXI.Point}
48
+ */
49
+ mousePosition: PIXI.Point;
50
+
45
51
  /**
46
52
  * An Array of pending canvas operations which should trigger on the next re-paint
47
53
  * @defaultValue `[]`
@@ -328,7 +334,7 @@ declare global {
328
334
  * (default: `{}`)
329
335
  * @returns A Promise which resolves once the animation has been completed
330
336
  */
331
- animatePan(view?: Partial<AnimatedPanView>): ReturnType<typeof CanvasAnimation.animateLinear>;
337
+ animatePan(view?: AnimatedPanView): ReturnType<typeof CanvasAnimation.animateLinear>;
332
338
 
333
339
  /**
334
340
  * Recenter the canvas
@@ -575,28 +581,28 @@ interface AnimatedPanView {
575
581
  /**
576
582
  * The destination x-coordinate
577
583
  */
578
- x?: number;
584
+ x?: number | null;
579
585
 
580
586
  /**
581
587
  * The destination y-coordinate
582
588
  */
583
- y?: number;
589
+ y?: number | null;
584
590
 
585
591
  /**
586
592
  * The destination zoom scale
587
593
  */
588
- scale?: number;
594
+ scale?: number | null;
589
595
 
590
596
  /**
591
597
  * The total duration of the animation in milliseconds; used if speed is not set
592
598
  * @defaultValue 250
593
599
  */
594
- duration: number;
600
+ duration?: number | null;
595
601
 
596
602
  /**
597
603
  * The speed of animation in pixels per second; overrides duration if set
598
604
  */
599
- speed?: number;
605
+ speed?: number | null;
600
606
  }
601
607
 
602
608
  interface EmbeddedEntityNameToLayerMap {
@@ -2,14 +2,9 @@ import type { ConfiguredDocumentClassForName } from '../../../../types/helperTyp
2
2
 
3
3
  declare global {
4
4
  /**
5
- * A Loader class which helps with loading video and image textures
5
+ * A Loader class which helps with loading video and image textures.
6
6
  */
7
7
  class TextureLoader {
8
- /**
9
- * The cached mapping of textures
10
- */
11
- cache: Map<string, { tex: PIXI.BaseTexture; time: number }>;
12
-
13
8
  /**
14
9
  * The duration in milliseconds for which a texture will remain cached
15
10
  * @defaultValue `1000 * 60 * 15`
@@ -43,51 +38,26 @@ declare global {
43
38
  loadTexture(src: string): Promise<PIXI.BaseTexture>;
44
39
 
45
40
  /**
46
- * Log texture loading progress in the console and in the Scene loading bar
47
- * @internal
41
+ * Load an image texture from a provided source url.
42
+ * @param src - The source image URL
43
+ * @returns The loaded BaseTexture
48
44
  */
49
- protected _onProgress(src: string, progress: TextureLoader.Progress): void;
50
-
51
- /**
52
- * Log failed texture loading
53
- * @internal
54
- */
55
- protected _onError(src: string, progress: TextureLoader.Progress, error: Error): void;
45
+ loadImageTexture(src: string): Promise<PIXI.BaseTexture>;
56
46
 
57
47
  /**
58
- * Load an image texture from a provided source url
48
+ * @param src - The source video URL
49
+ * @returns The loaded BaseTexture
59
50
  */
60
- loadImageTexture(src: string): Promise<PIXI.BaseTexture>;
51
+ loadVideoTexture(src: string): Promise<PIXI.BaseTexture>;
61
52
 
62
53
  /**
63
54
  * Use the Fetch API to retrieve a resource and return a Blob instance for it.
55
+ * @param src -
64
56
  * @param options - Options to configure the loading behaviour.
65
57
  * (default: `{}`)
66
- * @internal
67
- */
68
- protected _fetchResource(
69
- src: string,
70
- options?: {
71
- /**
72
- * Append a cache-busting query parameter to the request.
73
- * @defaultValue `false`
74
- */
75
- bustCache?: boolean | undefined;
76
- }
77
- ): Promise<Blob>;
78
-
79
- /**
80
- * Return a URL with a cache-busting query parameter appended.
81
- * @param src - The source URL being attempted
82
- * @returns The new URL, or false on a failure.
83
- * @internal
58
+ * @returns A Blob containing the loaded data
84
59
  */
85
- protected _getCacheBustURL(src: string): string | false;
86
-
87
- /**
88
- * Load a video texture from a provided source url
89
- */
90
- loadVideoTexture(src: string): Promise<PIXI.BaseTexture>;
60
+ static fetchResource(src: string, options?: TextureLoader.FetchResourceOptions): Promise<Blob>;
91
61
 
92
62
  /**
93
63
  * Add an image url to the texture cache
@@ -107,6 +77,13 @@ declare global {
107
77
  */
108
78
  expireCache(): void;
109
79
 
80
+ /**
81
+ * Return a URL with a cache-busting query parameter appended.
82
+ * @param src - The source URL being attempted
83
+ * @returns The new URL, or false on a failure.
84
+ */
85
+ static getCacheBustURL(src: string): string | false;
86
+
110
87
  /**
111
88
  * A global reference to the singleton texture loader
112
89
  */
@@ -142,6 +119,14 @@ declare global {
142
119
  total: number;
143
120
  pct: number;
144
121
  }
122
+
123
+ interface FetchResourceOptions {
124
+ /**
125
+ * Append a cache-busting query parameter to the request.
126
+ * @defaultValue `false`
127
+ */
128
+ bustCache?: boolean;
129
+ }
145
130
  }
146
131
 
147
132
  /**
@@ -160,11 +145,12 @@ declare global {
160
145
  * Load a single texture and return a Promise which resolves once the texture is ready to use
161
146
  * @param src - The requested texture source
162
147
  * @param options - Additional options which modify texture loading
148
+ * @returns The loaded Texture, or null if loading failed with no fallback
163
149
  */
164
150
  function loadTexture(
165
151
  src: string,
166
152
  options?: {
167
- /** A fallback texture to use if the requested source is unavailable or invalid */
153
+ /** A fallback texture URL to use if the requested source is unavailable */
168
154
  fallback?: string | undefined;
169
155
  }
170
156
  ): Promise<PIXI.Texture | null>;