Skip to content

Commit 2c5079d

Browse files
committed
1 parent 1bfc0e9 commit 2c5079d

File tree

7 files changed

+31
-24
lines changed

7 files changed

+31
-24
lines changed

src/foundry/client/apps/sidebar/directory-tab-mixin.d.mts

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ declare class DirectoryApplication {
4646
*/
4747
protected _matchSearchFolders(
4848
query: RegExp,
49-
includeFolder: (folder: Folder.ConfiguredInstance, autoExpand?: boolean) => boolean,
49+
/** @immediate */ includeFolder: (folder: Folder.ConfiguredInstance, autoExpand?: boolean) => boolean,
5050
): void;
5151

5252
/**
@@ -61,7 +61,7 @@ declare class DirectoryApplication {
6161
query: RegExp,
6262
entryIds: Set<string>,
6363
folderIds: Set<string>,
64-
includeFolder: (folder: Folder.ConfiguredInstance, autoExpand?: boolean) => boolean,
64+
/** @immediate */ includeFolder: (folder: Folder.ConfiguredInstance, autoExpand?: boolean) => boolean,
6565
): void;
6666

6767
/**

src/foundry/common/primitives/array.d.mts

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ declare global {
2525
* @param rule - The rule to partition by
2626
* @returns An Array of length two whose elements are the partitioned pieces of the original
2727
*/
28-
partition<S extends T>(rule: (val: T) => val is S): [Exclude<T, S>[], S[]];
29-
partition(rule: (val: T) => boolean): [T[], T[]];
28+
partition<S extends T>(/** @immediate */ rule: (val: T) => val is S): [Exclude<T, S>[], S[]];
29+
partition(/** @immediate */ rule: (val: T) => boolean): [T[], T[]];
3030

3131
/**
3232
* Join an Array using a string separator, first filtering out any parts which return a false-y value
@@ -41,7 +41,7 @@ declare global {
4141
* @param replace - A replacement for the spliced element
4242
* @returns The replacement element, the removed element, or null if no element was found.
4343
*/
44-
findSplice(find: (value: T, index: number, obj: T[]) => boolean, replace?: T): T | null;
44+
findSplice(/** @immediate */ find: (value: T, index: number, obj: T[]) => boolean, replace?: T): T | null;
4545
}
4646

4747
interface ArrayConstructor {

src/foundry/common/primitives/math.d.mts

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,6 @@ declare global {
9898
* Its period must be 2π
9999
* @returns The oscillation according to t. `((maxValue - minValue) * (f(2π * t / p) + 1) / 2) + minValue`
100100
*/
101-
oscillation(minVal: number, maxVal: number, t: number, p?: number, func?: (radians: number) => number): number;
101+
oscillation(minVal: number, maxVal: number, t: number, p?: number, /** @immediate */ func?: (radians: number) => number): number;
102102
}
103103
}

src/foundry/common/primitives/set.d.mts

+11-8
Original file line numberDiff line numberDiff line change
@@ -57,33 +57,33 @@ declare global {
5757
* @param test - The test criterion to apply. Positional arguments are the value, the index of iteration, and the set being tested.
5858
* @returns Does every element in the set satisfy the test criterion?
5959
*/
60-
every(test: (value: T, index: number, set: Set<T>) => boolean): boolean;
60+
every(/** @immediate */ test: (value: T, index: number, set: Set<T>) => boolean): boolean;
6161

6262
/**
6363
* Filter this set to create a subset of elements which satisfy a certain test criterion.
6464
* @see {@link Array#filter}
6565
* @param test - The test criterion to apply. Positional arguments are the value, the index of iteration, and the set being filtered.
6666
* @returns A new Set containing only elements which satisfy the test criterion.
6767
*/
68-
filter<F extends T>(test: (value: T, index: number, set: Set<T>) => value is F): Set<F>;
69-
filter(test: (value: T, index: number, set: Set<T>) => boolean): Set<T>;
68+
filter<F extends T>(/** @immediate */ test: (value: T, index: number, set: Set<T>) => value is F): Set<F>;
69+
filter(/** @immediate */ test: (value: T, index: number, set: Set<T>) => boolean): Set<T>;
7070

7171
/**
7272
* Find the first element in this set which satisfies a certain test criterion.
7373
* @see {@link Array#find}
7474
* @param test - The test criterion to apply. Positional arguments are the value, the index of iteration, and the set being searched.
7575
* @returns The first element in the set which satisfies the test criterion, or undefined.
7676
*/
77-
find<F extends T>(test: (value: T, index: number, set: Set<T>) => value is F): F | undefined;
78-
find(test: (value: T, index: number, set: Set<T>) => boolean): T | undefined;
77+
find<F extends T>(/** @immediate */ test: (value: T, index: number, set: Set<T>) => value is F): F | undefined;
78+
find(/** @immediate */ test: (value: T, index: number, set: Set<T>) => boolean): T | undefined;
7979

8080
/**
8181
* Create a new Set where every element is modified by a provided transformation function.
8282
* @see {@link Array#map}
8383
* @param transform - The transformation function to apply.Positional arguments are the value, the index of iteration, and the set being transformed.
8484
* @returns A new Set of equal size containing transformed elements.
8585
*/
86-
map<V>(transform: (value: T, index: number, set: Set<T>) => V): Set<V>;
86+
map<V>(/** @immediate */ transform: (value: T, index: number, set: Set<T>) => V): Set<V>;
8787

8888
/**
8989
* Create a new Set with elements that are filtered and transformed by a provided reducer function.
@@ -92,14 +92,17 @@ declare global {
9292
* @param accumulator - The initial value of the returned accumulator.
9393
* @returns The final value of the accumulator.
9494
*/
95-
reduce<V>(reducer: (accumulator: V, value: T, index: number, set: Set<T>) => V, accumulator: V): V;
95+
reduce<V>(
96+
/** @immediate */ reducer: (accumulator: V, value: T, index: number, set: Set<T>) => V,
97+
accumulator: V,
98+
): V;
9699

97100
/**
98101
* Test whether any element in this Set satisfies a certain test criterion.
99102
* @see {@link Array#some}
100103
* @param test - The test criterion to apply. Positional arguments are the value, the index of iteration, and the set being tested.
101104
* @returns Does any element in the set satisfy the test criterion?
102105
*/
103-
some(test: (value: T, index: number, set: Set<T>) => boolean): boolean;
106+
some(/** @immediate */ test: (value: T, index: number, set: Set<T>) => boolean): boolean;
104107
}
105108
}

src/foundry/common/prosemirror/dropdown.d.mts

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ declare class ProseMirrorDropDown {
4747
* Recurse through the menu structure and apply a function to each item in it.
4848
* @param fn - The function to call on each item. Return false to prevent iterating over any further items.
4949
*/
50-
forEachItem(fn: (entry: ProseMirrorDropDownMenu.Entry) => boolean): void;
50+
forEachItem(/** @immediate */ fn: (entry: ProseMirrorDropDownMenu.Entry) => boolean): void;
5151

5252
/**
5353
* Render a list of drop-down menu items.

src/foundry/common/utils/collection.d.mts

+8-8
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ declare class Collection<V> extends Map<string, V> {
3939
* c.get("a") === c.find(entry => entry === "A"); // true
4040
* ```
4141
*/
42-
find<S extends V>(condition: (e: V, index: number, collection: Collection<V>) => e is S): S | undefined;
43-
find(condition: (e: V, index: number, collection: Collection<V>) => boolean): V | undefined;
42+
find<S extends V>(/** @immediate */ condition: (e: V, index: number, collection: Collection<V>) => e is S): S | undefined;
43+
find(/** @immediate */ condition: (e: V, index: number, collection: Collection<V>) => boolean): V | undefined;
4444

4545
/**
4646
* Filter the Collection, returning an Array of entries which match a functional condition.
@@ -56,8 +56,8 @@ declare class Collection<V> extends Map<string, V> {
5656
* let hasA = c.filters(entry => entry.slice(0) === "A");
5757
* ```
5858
*/
59-
filter<S extends V>(condition: (e: V, index: number, collection: Collection<V>) => e is S): S[];
60-
filter(condition: (e: V, index: number, collection: Collection<V>) => boolean): V[];
59+
filter<S extends V>(/** @immediate */ condition: (e: V, index: number, collection: Collection<V>) => e is S): S[];
60+
filter(/** @immediate */ condition: (e: V, index: number, collection: Collection<V>) => boolean): V[];
6161

6262
/**
6363
* Apply a function to each element of the collection
@@ -70,7 +70,7 @@ declare class Collection<V> extends Map<string, V> {
7070
* c.forEach(e => e.active = true);
7171
* ```
7272
*/
73-
forEach(fn: (e: V) => void): void;
73+
forEach(/** @immediate */ fn: (e: V) => void): void;
7474

7575
/**
7676
* Get an element from the Collection by its key.
@@ -116,7 +116,7 @@ declare class Collection<V> extends Map<string, V> {
116116
* @typeParam M - The type of the mapped values
117117
* @returns An Array of transformed values
118118
*/
119-
map<M>(transformer: (entity: V, index: number, collection: Collection<V>) => M): M[];
119+
map<M>(/** @immediate */ transformer: (entity: V, index: number, collection: Collection<V>) => M): M[];
120120

121121
/**
122122
* Reduce the Collection by applying an evaluator function and accumulating entries
@@ -135,7 +135,7 @@ declare class Collection<V> extends Map<string, V> {
135135
* }, ""); // "ABC"
136136
* ```
137137
*/
138-
reduce<A>(evaluator: (accumulator: A, entity: V, index: number, collection: Collection<V>) => A, initial: A): A;
138+
reduce<A>(/** @immediate */ evaluator: (accumulator: A, entity: V, index: number, collection: Collection<V>) => A, initial: A): A;
139139

140140
/**
141141
* Test whether a condition is met by some entry in the Collection.
@@ -144,7 +144,7 @@ declare class Collection<V> extends Map<string, V> {
144144
* and the collection being tested.
145145
* @returns Was the test condition passed by at least one entry?
146146
*/
147-
some(condition: (e: V, index: number, collection: Collection<V>) => boolean): boolean;
147+
some(/** @immediate */ condition: (e: V, index: number, collection: Collection<V>) => boolean): boolean;
148148

149149
/**
150150
* Convert the Collection to a primitive array of its contents.

tsdoc.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
{
55
"tagName": "@abstract",
66
"syntaxKind": "modifier"
7-
}
7+
},
8+
{
9+
"tagName": "@immediate",
10+
"syntaxKind": "modifier"
11+
}
812
]
913
}

0 commit comments

Comments
 (0)