@league-of-foundry-developers/foundry-vtt-types 13.346.0-beta.20250823115730 → 13.346.0-beta.20250825015921
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 +1 -3
- package/src/configuration/globals.d.mts +1 -1
- package/src/foundry/client/_types.d.mts +2 -2
- package/src/foundry/client/applications/ui/scene-controls.d.mts +52 -2
- package/src/foundry/client/canvas/containers/elements/door-mesh.d.mts +3 -2
- package/src/foundry/client/canvas/interaction/render-flags.d.mts +11 -8
- package/src/foundry/client/canvas/perception/vision-mode.d.mts +10 -65
- package/src/foundry/client/canvas/primary/primary-graphics.d.mts +1 -8
- package/src/foundry/client/canvas/rendering/filters/_module.d.mts +1 -0
- package/src/foundry/client/canvas/rendering/shaders/base-shader.d.mts +7 -0
- package/src/foundry/client/client.d.mts +24 -0
- package/src/foundry/client/data/_module.d.mts +4 -2
- package/src/foundry/client/data/_types.d.mts +11 -0
- package/src/foundry/client/data/fields.d.mts +72 -0
- package/src/foundry/client/documents/abstract/canvas-document.d.mts +1 -1
- package/src/foundry/client/documents/abstract/client-document.d.mts +31 -6
- package/src/foundry/client/documents/actor.d.mts +3 -2
- package/src/foundry/client/documents/collections/compendium-collection.d.mts +111 -50
- package/src/foundry/client/documents/token.d.mts +6 -0
- package/src/foundry/client/helpers/localization.d.mts +2 -37
- package/src/foundry/client/packages/system.d.mts +5 -5
- package/src/foundry/client/utils/_module.d.mts +6 -5
- package/src/foundry/common/abstract/data.d.mts +87 -3
- package/src/foundry/common/abstract/embedded-collection.d.mts +5 -4
- package/src/foundry/common/abstract/type-data.d.mts +53 -11
- package/src/foundry/common/data/fields.d.mts +16 -2
- package/src/foundry/common/packages/_module.d.mts +2 -2
- package/src/foundry/common/packages/base-package.d.mts +12 -3
- package/src/foundry/common/packages/sub-types.d.mts +6 -3
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
3
3
|
"name": "@league-of-foundry-developers/foundry-vtt-types",
|
4
|
-
"version": "13.346.0-beta.
|
4
|
+
"version": "13.346.0-beta.20250825015921",
|
5
5
|
"description": "TypeScript type definitions for Foundry VTT",
|
6
6
|
"type": "module",
|
7
7
|
"types": "./src/index.d.mts",
|
@@ -266,9 +266,7 @@ export interface SettingConfig {
|
|
266
266
|
"core.chatBubbles": fields.BooleanField<{ initial: true }>;
|
267
267
|
"core.chatBubblesPan": fields.BooleanField<{ initial: true }>;
|
268
268
|
"core.combatTrackerConfig": MaybeEmpty<{ resource: string; skipDefeated: boolean }>;
|
269
|
-
"core.compendiumConfiguration":
|
270
|
-
Record<string, foundry.documents.collections.CompendiumCollection.Configuration>
|
271
|
-
>;
|
269
|
+
"core.compendiumConfiguration": foundry.documents.collections.CompendiumCollection.SettingField;
|
272
270
|
"core.gridTemplates": fields.BooleanField<{ initial: false }>;
|
273
271
|
"core.coneTemplateType": "round" | "flat";
|
274
272
|
"core.colorSchema": fields.StringField<{
|
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
// eslint-disable-next-line import-x/no-named-default
|
14
14
|
import { default as AlphaBlurFilter, AlphaBlurFilterPass } from "#client/canvas/rendering/filters/blur.mjs";
|
15
|
-
import { ShaderField } from "#client/
|
15
|
+
import { ShaderField } from "#client/data/fields.mjs";
|
16
16
|
import { DarknessLevelContainer } from "#client/canvas/layers/_module.mjs";
|
17
17
|
|
18
18
|
export import AVSettings = globalThis.AVSettings;
|
@@ -81,9 +81,9 @@ type ManageCompendiumRequest = unknown;
|
|
81
81
|
|
82
82
|
type ManageCompendiumResponse = unknown;
|
83
83
|
|
84
|
-
type WorldCompendiumPackConfiguration =
|
84
|
+
type WorldCompendiumPackConfiguration = foundry.documents.collections.CompendiumCollection.Configuration;
|
85
85
|
|
86
|
-
type WorldCompendiumConfiguration =
|
86
|
+
type WorldCompendiumConfiguration = foundry.documents.collections.CompendiumCollection.SettingData;
|
87
87
|
|
88
88
|
type SettingConfig = foundry.helpers.ClientSettings.SettingConfig;
|
89
89
|
|
@@ -115,14 +115,34 @@ declare namespace SceneControls {
|
|
115
115
|
}
|
116
116
|
|
117
117
|
/**
|
118
|
-
* The data structure for a set of controls in the {@
|
118
|
+
* The data structure for a set of controls in the {@linkcode SceneControls.controls | SceneControls#controls} record.
|
119
119
|
*/
|
120
120
|
interface Control {
|
121
|
+
/**
|
122
|
+
* A unique identifier for the control
|
123
|
+
*/
|
121
124
|
name: string;
|
125
|
+
|
126
|
+
/**
|
127
|
+
* An integer indicating the control's order, with 0 being at the top
|
128
|
+
*/
|
122
129
|
order: number;
|
130
|
+
|
131
|
+
/**
|
132
|
+
* A title for the control: can be a localization path
|
133
|
+
*/
|
123
134
|
title: string;
|
135
|
+
|
136
|
+
/**
|
137
|
+
* One or more icon classes for the control, typically Font Awesome classes such as `"fa-solid fa-face-smile"`
|
138
|
+
*/
|
124
139
|
icon: string;
|
140
|
+
|
141
|
+
/**
|
142
|
+
* Whether the control should be visible to the current User
|
143
|
+
*/
|
125
144
|
visible?: boolean | undefined;
|
145
|
+
|
126
146
|
tools: Record<string, Tool>;
|
127
147
|
|
128
148
|
/**
|
@@ -138,17 +158,47 @@ declare namespace SceneControls {
|
|
138
158
|
}
|
139
159
|
|
140
160
|
/**
|
141
|
-
* The data structure for a single tool in the {@
|
161
|
+
* The data structure for a single tool in the {@linkcode Control.tools | Control#tools} record.
|
142
162
|
*/
|
143
163
|
interface Tool {
|
164
|
+
/**
|
165
|
+
* An identifier for the tool, unique among the tools of its SceneControl
|
166
|
+
*/
|
144
167
|
name: string;
|
168
|
+
|
169
|
+
/**
|
170
|
+
* An integer indicating the tool's order, with 0 being at the top
|
171
|
+
*/
|
145
172
|
order: number;
|
173
|
+
|
174
|
+
/**
|
175
|
+
* A title for the tool: can be a localization path
|
176
|
+
*/
|
146
177
|
title: string;
|
178
|
+
|
179
|
+
/**
|
180
|
+
* One or more icon classes for the tool, typically Font Awesome classes such as `"fa-solid fa-face-smile"`
|
181
|
+
*/
|
147
182
|
icon: string;
|
148
183
|
|
184
|
+
/**
|
185
|
+
* Whether the tool should be visible to the current User
|
186
|
+
*/
|
149
187
|
visible?: boolean | undefined;
|
188
|
+
|
189
|
+
/**
|
190
|
+
* Is the tool an on-or-off toggle?
|
191
|
+
*/
|
150
192
|
toggle?: boolean | undefined;
|
193
|
+
|
194
|
+
/**
|
195
|
+
* Is the tool the currently the active one? Not applicable to toggles or buttons.
|
196
|
+
*/
|
151
197
|
active?: boolean | undefined;
|
198
|
+
|
199
|
+
/**
|
200
|
+
* Is the tool a "button" in the sense of immediately resolving on click without becoming the active tool?
|
201
|
+
*/
|
152
202
|
button?: boolean | undefined;
|
153
203
|
|
154
204
|
/** A callback invoked when the tool is activated or deactivated */
|
@@ -173,8 +173,8 @@ declare namespace DoorMesh {
|
|
173
173
|
* @remarks
|
174
174
|
* - For `swing` and `swivel` it's a linear scale from 0 (no movement) to 2 (180 degrees)
|
175
175
|
* - For `slide` it's door-lengths shifted
|
176
|
-
* - For `ascend` and `descend` it affects how much the texture grows/shrinks
|
177
|
-
*
|
176
|
+
* - For `ascend` and `descend` it affects how much the texture grows/shrinks, and for `ascend`
|
177
|
+
* it also affects the texture `alpha` (down to a minimum of `0.5` at strength `2.0`)
|
178
178
|
*/
|
179
179
|
strength: number;
|
180
180
|
|
@@ -218,6 +218,7 @@ declare namespace DoorMesh {
|
|
218
218
|
scaleX: number;
|
219
219
|
scaleY: number;
|
220
220
|
tint: number;
|
221
|
+
alpha: number;
|
221
222
|
}
|
222
223
|
}
|
223
224
|
|
@@ -94,8 +94,14 @@ declare class RenderFlags<Flags extends RenderFlags.ValidateFlags<Flags>> extend
|
|
94
94
|
/** @remarks `defineProperty`'d at construction with `enumerable: false, writable: false` and the value frozen. */
|
95
95
|
readonly flags: Readonly<Flags>;
|
96
96
|
|
97
|
-
/**
|
98
|
-
|
97
|
+
/**
|
98
|
+
* @remarks `defineProperty`'d at construction with `enumerable: false, writable: false`
|
99
|
+
*
|
100
|
+
* `| undefined` because Foundry marks both the constructor's `config` parameter and its {@linkcode RenderFlags.Config.object | object}
|
101
|
+
* property as optional, but in core usage the only place this is called is in the {@linkcode RenderFlagsObject} constructor, where it's
|
102
|
+
* passed `object: this`
|
103
|
+
*/
|
104
|
+
readonly object: RenderFlagObject | undefined;
|
99
105
|
|
100
106
|
/**
|
101
107
|
* The update priority when these render flags are applied.
|
@@ -134,13 +140,10 @@ declare namespace RenderFlags {
|
|
134
140
|
|
135
141
|
/**
|
136
142
|
* The ticker priority at which these render flags are handled
|
137
|
-
* @defaultValue
|
138
|
-
* @remarks
|
139
|
-
* Due to this the property has been marked required here, it can go back to optional if the default is fixed.
|
140
|
-
*
|
141
|
-
* See {@linkcode RenderFlags.priority | RenderFlags#priority}
|
143
|
+
* @defaultValue "OBJECTS"
|
144
|
+
* @remarks See {@linkcode RenderFlags.priority | RenderFlags#priority}
|
142
145
|
*/
|
143
|
-
priority
|
146
|
+
priority?: Priority | undefined;
|
144
147
|
}
|
145
148
|
|
146
149
|
/**
|
@@ -1,69 +1,8 @@
|
|
1
|
-
import type { AnyObject, Brand, ConcreteKeys, Identity, InterfaceToObject
|
1
|
+
import type { AnyObject, Brand, ConcreteKeys, Identity, InterfaceToObject } from "#utils";
|
2
2
|
import type { fields } from "#common/data/_module.d.mts";
|
3
|
-
import type { AbstractBaseShader } from "#client/canvas/rendering/shaders/_module.d.mts";
|
4
3
|
import type { DataModel } from "#common/abstract/_module.d.mts";
|
5
4
|
import type { PointVisionSource } from "#client/canvas/sources/_module.d.mts";
|
6
|
-
|
7
|
-
declare class ShaderField<
|
8
|
-
const Options extends ShaderField.Options = ShaderField.DefaultOptions,
|
9
|
-
const AssignmentType = ShaderField.AssignmentType<Options>,
|
10
|
-
const InitializedType = ShaderField.InitializedType<Options>,
|
11
|
-
const PersistedType extends typeof AbstractBaseShader | null | undefined = ShaderField.InitializedType<Options>,
|
12
|
-
> extends fields.DataField<Options, AssignmentType, InitializedType, PersistedType> {
|
13
|
-
/**
|
14
|
-
* @defaultValue
|
15
|
-
* ```typescript
|
16
|
-
* const defaults = super._defaults;
|
17
|
-
* defaults.nullable = true;
|
18
|
-
* defaults.initial = undefined;
|
19
|
-
* return defaults;
|
20
|
-
* ```
|
21
|
-
*/
|
22
|
-
static override get _defaults(): ShaderField.DefaultOptions;
|
23
|
-
|
24
|
-
/**
|
25
|
-
* @remarks
|
26
|
-
* @throws If the value provided is not an {@linkcode AbstractBaseShader} subclass.
|
27
|
-
*/
|
28
|
-
override _cast(value: unknown): AssignmentType; // typeof AbstractBaseShader;
|
29
|
-
}
|
30
|
-
|
31
|
-
declare namespace ShaderField {
|
32
|
-
type Options = fields.DataField.Options<typeof AbstractBaseShader>;
|
33
|
-
|
34
|
-
type DefaultOptions = SimpleMerge<
|
35
|
-
fields.DataField.DefaultOptions,
|
36
|
-
{
|
37
|
-
nullable: true;
|
38
|
-
initial: undefined;
|
39
|
-
}
|
40
|
-
>;
|
41
|
-
|
42
|
-
/**
|
43
|
-
* A helper type for the given options type merged into the default options of the BooleanField class.
|
44
|
-
* @template Opts - the options that override the default options
|
45
|
-
*/
|
46
|
-
type MergedOptions<Opts extends Options> = SimpleMerge<DefaultOptions, Opts>;
|
47
|
-
|
48
|
-
/**
|
49
|
-
* A shorthand for the assignment type of a BooleanField class.
|
50
|
-
* @template Opts - the options that override the default options
|
51
|
-
*/
|
52
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
53
|
-
type AssignmentType<Opts extends Options> = fields.DataField.DerivedAssignmentType<
|
54
|
-
typeof AbstractBaseShader,
|
55
|
-
MergedOptions<Opts>
|
56
|
-
>;
|
57
|
-
|
58
|
-
/**
|
59
|
-
* A shorthand for the initialized type of a BooleanField class.
|
60
|
-
* @template Opts - the options that override the default options
|
61
|
-
*/
|
62
|
-
type InitializedType<Opts extends Options> = fields.DataField.DerivedInitializedType<
|
63
|
-
typeof AbstractBaseShader,
|
64
|
-
MergedOptions<Opts>
|
65
|
-
>;
|
66
|
-
}
|
5
|
+
import type { fields as clientFields } from "#client/data/_module.d.mts";
|
67
6
|
|
68
7
|
/**
|
69
8
|
* A Vision Mode which can be selected for use by a Token.
|
@@ -161,7 +100,7 @@ declare namespace VisionMode {
|
|
161
100
|
}
|
162
101
|
|
163
102
|
interface ShaderSchema extends fields.DataSchema {
|
164
|
-
shader: ShaderField;
|
103
|
+
shader: clientFields.ShaderField;
|
165
104
|
uniforms: fields.ObjectField;
|
166
105
|
}
|
167
106
|
|
@@ -204,7 +143,7 @@ declare namespace VisionMode {
|
|
204
143
|
label: fields.StringField<{ blank: false }>;
|
205
144
|
tokenConfig: fields.BooleanField<{ initial: true }>;
|
206
145
|
canvas: fields.SchemaField<{
|
207
|
-
shader: ShaderField;
|
146
|
+
shader: clientFields.ShaderField;
|
208
147
|
uniforms: fields.ObjectField;
|
209
148
|
}>;
|
210
149
|
lighting: fields.SchemaField<LightingSchema>;
|
@@ -253,6 +192,12 @@ declare namespace VisionMode {
|
|
253
192
|
interface SourceData extends fields.SchemaField.SourceData<Schema> {}
|
254
193
|
}
|
255
194
|
|
195
|
+
/**
|
196
|
+
* @deprecated "Kept here for full compatibility" (since v13, until v14)
|
197
|
+
* @remarks Access via {@linkcode foundry.data.fields.ShaderField} instead
|
198
|
+
*/
|
199
|
+
declare const ShaderField: clientFields.ShaderField;
|
200
|
+
|
256
201
|
export { VisionMode as default, ShaderField };
|
257
202
|
|
258
203
|
declare class AnyVisionMode extends VisionMode {
|
@@ -8,12 +8,8 @@ import type { PlaceableObject } from "#client/canvas/placeables/_module.d.mts";
|
|
8
8
|
declare class PrimaryGraphics extends PrimaryCanvasObjectMixin(PIXI.smooth.SmoothGraphics) {
|
9
9
|
/**
|
10
10
|
* @param options - A config object
|
11
|
-
* @remarks Passing a {@linkcode PIXI.smooth.SmoothGraphicsGeometry} instead of an `options` should be supported here,
|
12
|
-
* but has been disabled due to a core bug: {@link https://github.com/foundryvtt/foundryvtt/issues/13170}
|
13
|
-
*
|
14
|
-
* If you need to pass a specific geometry instead of using a default `new SmoothGraphicsGeometry`, pass it as `options.geometry`.
|
15
11
|
*/
|
16
|
-
constructor(options?: PrimaryGraphics.ConstructorOptions);
|
12
|
+
constructor(options?: PrimaryGraphics.ConstructorOptions | PIXI.smooth.SmoothGraphicsGeometry);
|
17
13
|
|
18
14
|
protected override _calculateCanvasBounds(): void;
|
19
15
|
|
@@ -34,9 +30,6 @@ declare namespace PrimaryGraphics {
|
|
34
30
|
* A geometry passed to the graphics.
|
35
31
|
* @defaultValue {@linkcode PIXI.smooth.SmoothGraphicsGeometry | new PIXI.smooth.SmoothGraphicsGeometry()}
|
36
32
|
* @remarks Default applied in the {@linkcode PIXI.smooth.SmoothGraphics} constructor.
|
37
|
-
*
|
38
|
-
* @privateRemarks Foundry types this incorrectly because they didn't update it when they switched base classes:
|
39
|
-
* {@link https://github.com/foundryvtt/foundryvtt/issues/13170}
|
40
33
|
*/
|
41
34
|
geometry: PIXI.smooth.SmoothGraphicsGeometry;
|
42
35
|
|
@@ -21,3 +21,4 @@ export { default as VisibilityFilter } from "./visibility.mjs";
|
|
21
21
|
export { default as VisionMaskFilter } from "./vision-mask-filter.mjs";
|
22
22
|
export { default as VoidFilter } from "./void.mjs";
|
23
23
|
export { default as WeatherOcclusionMaskFilter } from "./weather-occlusion-mask.mjs";
|
24
|
+
export { default as AlphaBlurFilter, AlphaBlurFilterPass } from "./blur.mjs";
|
@@ -11,6 +11,13 @@ declare abstract class AbstractBaseShader extends BaseShaderMixin(PIXI.Shader) {
|
|
11
11
|
*/
|
12
12
|
constructor(program: PIXI.Program, uniforms?: AbstractBaseShader.Uniforms);
|
13
13
|
|
14
|
+
/**
|
15
|
+
* Identify this class to be compatible with ShaderField
|
16
|
+
* @internal
|
17
|
+
* @remarks This is `defineProperty`'d on the class after its definition, with `writable: false, enumerable: false, configurable: false`
|
18
|
+
*/
|
19
|
+
protected static readonly _isShaderFieldCompatible: true;
|
20
|
+
|
14
21
|
/**
|
15
22
|
* The raw vertex shader used by this class.
|
16
23
|
* A subclass of AbstractBaseShader must implement the vertexShader static field.
|
@@ -1124,6 +1124,12 @@ declare global {
|
|
1124
1124
|
*/
|
1125
1125
|
export import CanvasVisionMask = foundry.canvas.layers.CanvasVisionMask;
|
1126
1126
|
|
1127
|
+
/**
|
1128
|
+
* @deprecated "You are accessing the global {@linkcode DarknessLevelContainer} which is now namespaced under {@linkcode foundry.canvas.layers.DarknessLevelContainer}"
|
1129
|
+
* (since v13 will be removed in v15)
|
1130
|
+
*/
|
1131
|
+
export import DarknessLevelContainer = foundry.canvas.layers.DarknessLevelContainer;
|
1132
|
+
|
1127
1133
|
/**
|
1128
1134
|
* @deprecated "You are accessing the global {@linkcode DrawingsLayer} which is now namespaced under {@linkcode foundry.canvas.layers.DrawingsLayer}"
|
1129
1135
|
* (since v13 will be removed in v15)
|
@@ -1256,6 +1262,12 @@ declare global {
|
|
1256
1262
|
*/
|
1257
1263
|
export import UnboundTransform = foundry.canvas.geometry.UnboundTransform;
|
1258
1264
|
|
1265
|
+
/**
|
1266
|
+
* @deprecated "You are accessing the global {@linkcode ObservableTransform} which is now namespaced under {@linkcode foundry.canvas.geometry.ObservableTransform}"
|
1267
|
+
* (since v13 will be removed in v15)
|
1268
|
+
*/
|
1269
|
+
export import ObservableTransform = foundry.canvas.geometry.ObservableTransform;
|
1270
|
+
|
1259
1271
|
/**
|
1260
1272
|
* @deprecated "You are accessing the global {@linkcode LimitedAnglePolygon} which is now namespaced under {@linkcode foundry.canvas.geometry.LimitedAnglePolygon}"
|
1261
1273
|
* (since v13 will be removed in v15)
|
@@ -1592,6 +1604,18 @@ declare global {
|
|
1592
1604
|
*/
|
1593
1605
|
export import VoidFilter = foundry.canvas.rendering.filters.VoidFilter;
|
1594
1606
|
|
1607
|
+
/**
|
1608
|
+
* @deprecated "You are accessing the global {@linkcode AlphaBlurFilter} which is now namespaced under {@linkcode foundry.canvas.rendering.filters.AlphaBlurFilter}"
|
1609
|
+
* (since v13 will be removed in v15)
|
1610
|
+
*/
|
1611
|
+
export import AlphaBlurFilter = foundry.canvas.rendering.filters.AlphaBlurFilter;
|
1612
|
+
|
1613
|
+
/**
|
1614
|
+
* @deprecated "You are accessing the global {@linkcode AlphaBlurFilterPass} which is now namespaced under {@linkcode foundry.canvas.rendering.filters.AlphaBlurFilterPass}"
|
1615
|
+
* (since v13 will be removed in v15)
|
1616
|
+
*/
|
1617
|
+
export import AlphaBlurFilterPass = foundry.canvas.rendering.filters.AlphaBlurFilterPass;
|
1618
|
+
|
1595
1619
|
/**
|
1596
1620
|
* @deprecated "You are accessing the global {@linkcode WeatherOcclusionMaskFilter} which is now namespaced under {@linkcode foundry.canvas.rendering.filters.WeatherOcclusionMaskFilter}"
|
1597
1621
|
* (since v13 will be removed in v15)
|
@@ -3,11 +3,13 @@
|
|
3
3
|
// While `.mts` could work, to avoid `import-x/no-unresolved` from erroring `.mjs` is used.
|
4
4
|
/* eslint-disable import-x/extensions */
|
5
5
|
|
6
|
-
|
6
|
+
export * as types from "./_types.mjs";
|
7
7
|
export * from "#common/data/_module.mjs";
|
8
8
|
export * as regionBehaviors from "./region-behaviors/_module.mjs";
|
9
9
|
export * as regionShapes from "./region-shapes/_module.mjs";
|
10
|
+
export * as fields from "./fields.mjs";
|
10
11
|
export * from "./terrain-data.mjs";
|
11
12
|
export { default as CombatConfiguration } from "./combat-config.mjs";
|
12
13
|
export { default as ClientDatabaseBackend } from "./client-backend.mjs";
|
13
|
-
export { default as CalendarData
|
14
|
+
export { default as CalendarData } from "./calendar.mjs";
|
15
|
+
export * from "./calendar.mjs";
|
@@ -8,3 +8,14 @@
|
|
8
8
|
import type CombatConfiguration from "./combat-config.d.mts";
|
9
9
|
|
10
10
|
type CombatConfigurationData = CombatConfiguration.Data;
|
11
|
+
type CalendarConfig = unknown;
|
12
|
+
type CalendarConfigYears = unknown;
|
13
|
+
type CalendarConfigLeapYear = unknown;
|
14
|
+
type CalendarConfigMonths = unknown;
|
15
|
+
type CalendarConfigMonth = unknown;
|
16
|
+
type CalendarConfigDays = unknown;
|
17
|
+
type CalendarConfigDay = unknown;
|
18
|
+
type CalendarConfigSeasons = unknown;
|
19
|
+
type CalendarConfigSeason = unknown;
|
20
|
+
type TimeComponents = unknown;
|
21
|
+
type TimeFormatter = unknown;
|
@@ -0,0 +1,72 @@
|
|
1
|
+
import type { SimpleMerge } from "#utils";
|
2
|
+
import type { fields } from "#common/data/_module.d.mts";
|
3
|
+
import type { AbstractBaseShader } from "#client/canvas/rendering/shaders/_module.d.mts";
|
4
|
+
|
5
|
+
declare class ShaderField<
|
6
|
+
const Options extends ShaderField.Options = ShaderField.DefaultOptions,
|
7
|
+
const AssignmentType = ShaderField.AssignmentType<Options>,
|
8
|
+
const InitializedType = ShaderField.InitializedType<Options>,
|
9
|
+
const PersistedType extends typeof AbstractBaseShader | null | undefined = ShaderField.InitializedType<Options>,
|
10
|
+
> extends fields.DataField<Options, AssignmentType, InitializedType, PersistedType> {
|
11
|
+
/**
|
12
|
+
* @defaultValue
|
13
|
+
* ```typescript
|
14
|
+
* const defaults = super._defaults;
|
15
|
+
* defaults.nullable = true;
|
16
|
+
* defaults.initial = undefined;
|
17
|
+
* return defaults;
|
18
|
+
* ```
|
19
|
+
*/
|
20
|
+
static override get _defaults(): ShaderField.DefaultOptions;
|
21
|
+
|
22
|
+
/**
|
23
|
+
* @remarks
|
24
|
+
* @throws If the value provided is not an {@linkcode AbstractBaseShader} subclass.
|
25
|
+
*/
|
26
|
+
override _cast(value: unknown): AssignmentType; // typeof AbstractBaseShader;
|
27
|
+
}
|
28
|
+
|
29
|
+
declare namespace ShaderField {
|
30
|
+
type Options = fields.DataField.Options<typeof AbstractBaseShader>;
|
31
|
+
|
32
|
+
type DefaultOptions = SimpleMerge<
|
33
|
+
fields.DataField.DefaultOptions,
|
34
|
+
{
|
35
|
+
nullable: true;
|
36
|
+
initial: undefined;
|
37
|
+
}
|
38
|
+
>;
|
39
|
+
|
40
|
+
/**
|
41
|
+
* A helper type for the given options type merged into the default options of the BooleanField class.
|
42
|
+
* @template Opts - the options that override the default options
|
43
|
+
*/
|
44
|
+
type MergedOptions<Opts extends Options> = SimpleMerge<DefaultOptions, Opts>;
|
45
|
+
|
46
|
+
/**
|
47
|
+
* A shorthand for the assignment type of a BooleanField class.
|
48
|
+
* @template Opts - the options that override the default options
|
49
|
+
*/
|
50
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
51
|
+
type AssignmentType<Opts extends Options> = fields.DataField.DerivedAssignmentType<
|
52
|
+
typeof AbstractBaseShader,
|
53
|
+
MergedOptions<Opts>
|
54
|
+
>;
|
55
|
+
|
56
|
+
/**
|
57
|
+
* A shorthand for the initialized type of a BooleanField class.
|
58
|
+
* @template Opts - the options that override the default options
|
59
|
+
*/
|
60
|
+
type InitializedType<Opts extends Options> = fields.DataField.DerivedInitializedType<
|
61
|
+
typeof AbstractBaseShader,
|
62
|
+
MergedOptions<Opts>
|
63
|
+
>;
|
64
|
+
}
|
65
|
+
|
66
|
+
export { ShaderField };
|
67
|
+
|
68
|
+
/**
|
69
|
+
* @remarks The `export * as fields` in `./_module.mjs` overwrites the re-export of `common/data/_module.mjs`'s `fields`,
|
70
|
+
* so the common fields are also re-exported here. This matches how Foundry's exports are handled.
|
71
|
+
*/
|
72
|
+
export * from "#common/data/fields.mjs";
|
@@ -53,7 +53,7 @@ declare function CanvasDocumentMixin<BaseClass extends CanvasDocumentMixin.BaseC
|
|
53
53
|
): CanvasDocumentMixin.Mix<BaseClass>;
|
54
54
|
|
55
55
|
declare namespace CanvasDocumentMixin {
|
56
|
-
interface AnyMixedConstructor extends ReturnType<typeof foundry.documents.abstract.
|
56
|
+
interface AnyMixedConstructor extends ReturnType<typeof foundry.documents.abstract.CanvasDocumentMixin<BaseClass>> {}
|
57
57
|
interface AnyMixed extends FixedInstanceType<AnyMixedConstructor> {}
|
58
58
|
|
59
59
|
type Mix<BaseClass extends CanvasDocumentMixin.BaseClass> = Mixin<
|
@@ -15,7 +15,7 @@ import type ApplicationV2 from "#client/applications/api/application.d.mts";
|
|
15
15
|
import type TextEditor from "#client/applications/ux/text-editor.mjs";
|
16
16
|
|
17
17
|
declare class InternalClientDocument<DocumentName extends Document.Type> {
|
18
|
-
/** @privateRemarks All mixin
|
18
|
+
/** @privateRemarks All mixin classes should accept anything for its constructor. */
|
19
19
|
constructor(...args: any[]);
|
20
20
|
|
21
21
|
/**
|
@@ -117,15 +117,35 @@ declare class InternalClientDocument<DocumentName extends Document.Type> {
|
|
117
117
|
protected _safePrepareData(): void;
|
118
118
|
|
119
119
|
/**
|
120
|
-
* Prepare data for the Document. This method
|
121
|
-
*
|
122
|
-
* The work done by this method should be idempotent
|
123
|
-
* than once.
|
120
|
+
* Prepare data for the Document. This method provides an opportunity for Document classes to define special data
|
121
|
+
* preparation logic to compute values that don't need to be stored in the database, such as a "bloodied" hp value
|
122
|
+
* or the total carrying weight of items. The work done by this method should be idempotent per initialization.
|
123
|
+
* There are situations in which prepareData may be called more than once.
|
124
|
+
*
|
125
|
+
* By default, foundry calls the following methods in order whenever the document is created or updated.
|
126
|
+
* 1. {@linkcode foundry.abstract.DataModel.reset | reset} (Inherited from DataModel)
|
127
|
+
* 2. {@linkcode _initialize} (Inherited from DataModel)
|
128
|
+
* 3. {@linkcode prepareData}
|
129
|
+
* 4. {@linkcode foundry.abstract.TypeDataModel.prepareBaseData | TypeDataModel#prepareBaseData}
|
130
|
+
* 5. {@linkcode prepareBaseData}
|
131
|
+
* 6. {@linkcode prepareEmbeddedDocuments}
|
132
|
+
* 7. {@linkcode foundry.abstract.TypeDataModel.prepareDerivedData | TypeDataModel#prepareBaseData}
|
133
|
+
* 8. {@linkcode prepareDerivedData}
|
134
|
+
*
|
135
|
+
* Do NOT invoke database operations like {@linkcode Document.update | update} or {@linkcode Document.setFlag | setFlag} within data prep, as that can cause an
|
136
|
+
* infinite loop by re-triggering the data initialization process.
|
137
|
+
*
|
138
|
+
* If possible you should extend {@linkcode prepareBaseData} and {@linkcode prepareDerivedData} instead of this function
|
139
|
+
* directly, but some systems with more complicated calculations may want to override this function to add extra
|
140
|
+
* steps, such as to calculate certain item values after actor data prep.
|
124
141
|
*/
|
125
142
|
prepareData(): void;
|
126
143
|
|
127
144
|
/**
|
128
145
|
* Prepare data related to this Document itself, before any embedded Documents or derived data is computed.
|
146
|
+
*
|
147
|
+
* If possible when modifying the `system` object you should use {@linkcode foundry.abstract.TypeDataModel.prepareBaseData | TypeDataModel#prepareBaseData} on
|
148
|
+
* your data models instead of this method directly on the document.
|
129
149
|
*/
|
130
150
|
prepareBaseData(): void;
|
131
151
|
|
@@ -497,11 +517,16 @@ declare const _ClientDocument: _ClientDocumentType;
|
|
497
517
|
// FIXME(LukeAbby): Unlike most mixins, `ClientDocumentMixin` actually requires a specific constructor, the same as `Document`.
|
498
518
|
// This means that `BaseClass extends Document.Internal.Constructor` is actually too permissive.
|
499
519
|
// However this easily leads to circularities.
|
500
|
-
declare function ClientDocumentMixin<BaseClass extends
|
520
|
+
declare function ClientDocumentMixin<BaseClass extends ClientDocumentMixin.BaseClass>(
|
501
521
|
Base: BaseClass,
|
502
522
|
): ClientDocumentMixin.Mix<BaseClass>;
|
503
523
|
|
504
524
|
declare namespace ClientDocumentMixin {
|
525
|
+
interface AnyMixedConstructor extends ReturnType<typeof foundry.documents.abstract.ClientDocumentMixin<BaseClass>> {}
|
526
|
+
interface AnyMixed extends FixedInstanceType<AnyMixedConstructor> {}
|
527
|
+
|
528
|
+
type BaseClass = Document.Internal.Constructor;
|
529
|
+
|
505
530
|
type Mix<BaseClass extends Document.Internal.Constructor> = Mixin<
|
506
531
|
typeof InternalClientDocument<Document.NameFor<BaseClass>>,
|
507
532
|
BaseClass
|
@@ -696,8 +696,9 @@ declare class Actor<out SubType extends Actor.SubType = Actor.SubType> extends f
|
|
696
696
|
protected override _configure(options?: Document.ConfigureOptions): void;
|
697
697
|
|
698
698
|
/**
|
699
|
-
* Maintain a list of Token Documents that represent this Actor, stored by Scene.
|
700
|
-
*
|
699
|
+
* Maintain a list of Token Documents that represent this Actor, stored by Scene. This list may include unpersisted
|
700
|
+
* Token Documents (along with possibly unpersisted parent Scenes), including those with a null `_id`.
|
701
|
+
* @remarks `defineProperty`'d at construction with no options specified
|
701
702
|
*/
|
702
703
|
protected _dependentTokens?: foundry.utils.IterableWeakMap<
|
703
704
|
Scene.Implementation,
|