@league-of-foundry-developers/foundry-vtt-types 13.346.0-beta.20250825015921 → 13.346.0-beta.20250825021358
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 +1 -1
- package/src/configuration/configuration.d.mts +3 -3
- package/src/foundry/client/audio/_types.d.mts +11 -0
- package/src/foundry/client/audio/biquad.d.mts +7 -9
- package/src/foundry/client/audio/cache.d.mts +3 -2
- package/src/foundry/client/audio/convolver.d.mts +2 -6
- package/src/foundry/client/audio/helper.d.mts +263 -87
- package/src/foundry/client/audio/sound.d.mts +172 -70
- package/src/foundry/client/audio/timeout.d.mts +9 -3
- package/src/foundry/common/primitives/math.d.mts +19 -17
- package/src/foundry/common/primitives/number.d.mts +17 -13
- package/src/foundry/common/primitives/set.d.mts +14 -28
- package/src/foundry/common/primitives/string.d.mts +2 -1
- package/src/foundry/common/primitives/url.d.mts +5 -1
- package/src/utils/index.d.mts +1 -1
@@ -2,20 +2,13 @@ export {};
|
|
2
2
|
|
3
3
|
declare global {
|
4
4
|
interface Set<T> {
|
5
|
-
/**
|
6
|
-
* Return the difference of two sets.
|
7
|
-
* @param other - Some other set to compare against
|
8
|
-
* @returns The difference defined as objects in this which are not present in other
|
9
|
-
*/
|
10
|
-
difference(other: Set<T>): Set<T>;
|
11
|
-
|
12
5
|
/**
|
13
6
|
* Test whether this set is equal to some other set.
|
14
7
|
* Sets are equal if they share the same members, independent of order
|
15
8
|
* @param other - Some other set to compare against
|
16
9
|
* @returns Are the sets equal?
|
17
10
|
*/
|
18
|
-
equals(other:
|
11
|
+
equals(other: ReadonlySetLike<unknown>): boolean;
|
19
12
|
|
20
13
|
/**
|
21
14
|
* Return the first value from the set.
|
@@ -23,27 +16,22 @@ declare global {
|
|
23
16
|
*/
|
24
17
|
first(): T | undefined;
|
25
18
|
|
26
|
-
/**
|
27
|
-
* Return the intersection of two sets.
|
28
|
-
* @param other - Some other set to compare against
|
29
|
-
* @returns The intersection of both sets
|
30
|
-
*/
|
31
|
-
intersection(other: Set<T>): Set<T>;
|
32
|
-
|
33
19
|
/**
|
34
20
|
* Test whether this set has an intersection with another set.
|
35
21
|
* @param other - Another set to compare against
|
36
22
|
* @returns Do the sets intersect?
|
23
|
+
* @remarks Just returns {@linkcode Set.isDisjointFrom | !this.isDisjointFrom(other)}
|
37
24
|
*/
|
38
|
-
intersects(other:
|
25
|
+
intersects(other: ReadonlySetLike<unknown>): boolean;
|
39
26
|
|
40
27
|
/**
|
41
28
|
* Test whether this set is a subset of some other set.
|
42
29
|
* A set is a subset if all its members are also present in the other set.
|
43
30
|
* @param other - Some other set that may be a subset of this one
|
44
31
|
* @returns Is the other set a subset of this one?
|
32
|
+
* @deprecated "`Set#isSubset` is deprecated in favor of the native {@linkcode Set.isSubsetOf | Set#isSubsetOf}." (since v13, until v15)
|
45
33
|
*/
|
46
|
-
isSubset(other:
|
34
|
+
isSubset(other: ReadonlySetLike<unknown>): boolean;
|
47
35
|
|
48
36
|
/**
|
49
37
|
* Convert a set to a JSON object by mapping its contents to an array
|
@@ -53,15 +41,16 @@ declare global {
|
|
53
41
|
|
54
42
|
/**
|
55
43
|
* Test whether every element in this Set satisfies a certain test criterion.
|
56
|
-
* @see {@
|
44
|
+
* @see {@linkcode Array.every | Array#every}
|
57
45
|
* @param test - The test criterion to apply. Positional arguments are the value, the index of iteration, and the set being tested.
|
58
46
|
* @returns Does every element in the set satisfy the test criterion?
|
59
47
|
*/
|
48
|
+
every<S extends T>(/** @immediate */ test: (value: T, index: number, set: Set<T>) => value is S): this is Set<S>;
|
60
49
|
every(/** @immediate */ test: (value: T, index: number, set: Set<T>) => boolean): boolean;
|
61
50
|
|
62
51
|
/**
|
63
52
|
* Filter this set to create a subset of elements which satisfy a certain test criterion.
|
64
|
-
* @see {@
|
53
|
+
* @see {@linkcode Array.filter | Array#filter}
|
65
54
|
* @param test - The test criterion to apply. Positional arguments are the value, the index of iteration, and the set being filtered.
|
66
55
|
* @returns A new Set containing only elements which satisfy the test criterion.
|
67
56
|
*/
|
@@ -70,7 +59,7 @@ declare global {
|
|
70
59
|
|
71
60
|
/**
|
72
61
|
* Find the first element in this set which satisfies a certain test criterion.
|
73
|
-
* @see {@
|
62
|
+
* @see {@linkcode Array.find | Array#find}
|
74
63
|
* @param test - The test criterion to apply. Positional arguments are the value, the index of iteration, and the set being searched.
|
75
64
|
* @returns The first element in the set which satisfies the test criterion, or undefined.
|
76
65
|
*/
|
@@ -79,7 +68,7 @@ declare global {
|
|
79
68
|
|
80
69
|
/**
|
81
70
|
* Create a new Set where every element is modified by a provided transformation function.
|
82
|
-
* @see {@
|
71
|
+
* @see {@linkcode Array.map | Array#map}
|
83
72
|
* @param transform - The transformation function to apply.Positional arguments are the value, the index of iteration, and the set being transformed.
|
84
73
|
* @returns A new Set of equal size containing transformed elements.
|
85
74
|
*/
|
@@ -87,19 +76,16 @@ declare global {
|
|
87
76
|
|
88
77
|
/**
|
89
78
|
* Create a new Set with elements that are filtered and transformed by a provided reducer function.
|
90
|
-
* @see {@
|
79
|
+
* @see {@linkcode Array.reduce | Array#reduce}
|
91
80
|
* @param reducer - A reducer function applied to each value. Positional arguments are the accumulator, the value, the index of iteration, and the set being reduced.
|
92
|
-
* @param
|
81
|
+
* @param initial - The initial value of the returned accumulator.
|
93
82
|
* @returns The final value of the accumulator.
|
94
83
|
*/
|
95
|
-
reduce<V>(
|
96
|
-
/** @immediate */ reducer: (accumulator: V, value: T, index: number, set: Set<T>) => V,
|
97
|
-
accumulator: V,
|
98
|
-
): V;
|
84
|
+
reduce<V>(/** @immediate */ reducer: (accumulator: V, value: T, index: number, set: Set<T>) => V, initial: V): V;
|
99
85
|
|
100
86
|
/**
|
101
87
|
* Test whether any element in this Set satisfies a certain test criterion.
|
102
|
-
* @see {@
|
88
|
+
* @see {@linkcode Array.some | Array#some}
|
103
89
|
* @param test - The test criterion to apply. Positional arguments are the value, the index of iteration, and the set being tested.
|
104
90
|
* @returns Does any element in the set satisfy the test criterion?
|
105
91
|
*/
|
@@ -9,12 +9,13 @@ declare global {
|
|
9
9
|
|
10
10
|
/**
|
11
11
|
* Compare this string (x) with the other string (y) by comparing each character's Unicode code point value.
|
12
|
+
* Returns a negative Number if x \< y, a positive Number if x\> y, or a zero otherwise.
|
12
13
|
* This is the same comparison function that used by Array#sort if the compare function argument is omitted.
|
13
14
|
* The result is host/locale-independent.
|
14
15
|
* @param other - The other string to compare this string to.
|
15
16
|
* @returns A negative Number if x \< y, a positive Number if x \> y, or a zero otherwise.
|
16
17
|
*/
|
17
|
-
compare<S extends string>(this: S, other: string):
|
18
|
+
compare<S extends string>(this: S, other: string): -1 | 0 | 1;
|
18
19
|
|
19
20
|
/**
|
20
21
|
* Convert a string to Title Case where the first letter of each word is capitalized
|
@@ -3,11 +3,15 @@ export {};
|
|
3
3
|
declare global {
|
4
4
|
// Non-functional due to upstream
|
5
5
|
// https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1379
|
6
|
-
//
|
6
|
+
// Foundry's override is redundant in 2025, as the native `URL.parse` (https://developer.mozilla.org/en-US/docs/Web/API/URL/parse_static)
|
7
|
+
// is a drop-in replacement
|
8
|
+
// const URL: {
|
7
9
|
// prototype: URL;
|
8
10
|
// new (url: string | URL, base?: string | URL): URL;
|
9
11
|
// createObjectURL(obj: Blob | MediaSource): string;
|
10
12
|
// revokeObjectURL(url: string): void;
|
13
|
+
// canParse(url: string | URL, base?: string | URL): boolean;
|
14
|
+
// parse(url: string | URL, base?: string | URL): URL | null;
|
11
15
|
// /**
|
12
16
|
// * Attempt to parse a URL without throwing an error.
|
13
17
|
// * @param url - The string to parse.
|
package/src/utils/index.d.mts
CHANGED
@@ -82,7 +82,7 @@ export type IntentionalPartial<T extends object> = Partial<T>;
|
|
82
82
|
*
|
83
83
|
* @example
|
84
84
|
* ```ts
|
85
|
-
* // The `const T` allows inference to be a bit more specific. This is useful for a utility type like this
|
85
|
+
* // The `const T` allows inference to be a bit more specific. This is useful for a utility type like this.
|
86
86
|
* function takesNumber<const T>(input: OverlapsWith<T, number>): void {
|
87
87
|
* // This function body is an example of a method this might be useful for.
|
88
88
|
* // If the input isn't an number it simply returns in this case.
|