@league-of-foundry-developers/foundry-vtt-types 9.255.1 → 9.255.2

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.255.1",
3
+ "version": "9.255.2",
4
4
  "description": "TypeScript type definitions for Foundry VTT",
5
5
  "exports": {
6
6
  ".": {
@@ -95,7 +95,10 @@ interface SettingSubmenuConfig {
95
95
  icon?: string | undefined;
96
96
 
97
97
  /** The FormApplication to render */
98
- type: ConstructorOf<FormApplication<FormApplicationOptions, object, undefined>>;
98
+ // TODO: Find a better way to type this. Ideally, we would find a way to conditionally make the first parameter of FormApplication optional...
99
+ type:
100
+ | (new () => FormApplication<any, any, any>)
101
+ | ConstructorOf<FormApplication<FormApplicationOptions, object, undefined>>;
99
102
 
100
103
  /** If true, only a GM can edit this Setting */
101
104
  restricted?: boolean | undefined;
@@ -119,10 +122,10 @@ interface KeybindingActionConfig {
119
122
  editable?: KeybindingActionBinding[];
120
123
 
121
124
  /** A function to execute when a key down event occurs. If True is returned, the event is consumed and no further keybinds execute. */
122
- onDown?: () => boolean | void;
125
+ onDown?: (ctx: KeyboardEventContext) => boolean | void;
123
126
 
124
127
  /** A function to execute when a key up event occurs. If True is returned, the event is consumed and no further keybinds execute. */
125
- onUp?: () => boolean | void;
128
+ onUp?: (ctx: KeyboardEventContext) => boolean | void;
126
129
 
127
130
  /** If True, allows Repeat events to execute the Action's onDown. Defaults to false. */
128
131
  repeat?: boolean;
@@ -1,3 +1,13 @@
1
+ interface DialogOptions extends ApplicationOptions {
2
+ /**
3
+ * Whether to provide jQuery objects to callback functions (if true) or plain
4
+ * HTMLElement instances (if false). This is currently true by default but in the
5
+ * future will become false by default.
6
+ * @defaultValue `true`
7
+ */
8
+ jQuery: boolean;
9
+ }
10
+
1
11
  /**
2
12
  * Create a modal dialog window displaying a title, a message, and a set of buttons which trigger callback functions.
3
13
  *
@@ -26,7 +36,7 @@
26
36
  * ```
27
37
  * @typeParam Options - the type of the options object
28
38
  */
29
- declare class Dialog<Options extends Dialog.Options = Dialog.Options> extends Application<Options> {
39
+ declare class Dialog<Options extends DialogOptions = DialogOptions> extends Application<Options> {
30
40
  /**
31
41
  * @param data - An object of dialog data which configures how the modal window is rendered
32
42
  * @param options - Dialog rendering options, see {@link Application}
@@ -47,7 +57,7 @@ declare class Dialog<Options extends Dialog.Options = Dialog.Options> extends Ap
47
57
  * })
48
58
  * ```
49
59
  */
50
- static get defaultOptions(): Dialog.Options;
60
+ static get defaultOptions(): DialogOptions;
51
61
 
52
62
  /**
53
63
  * @override
@@ -192,31 +202,6 @@ declare namespace Dialog {
192
202
  */
193
203
  default: string;
194
204
  }
195
-
196
- interface Options extends ApplicationOptions {
197
- /**
198
- * @defaultValue `400`
199
- */
200
- width: number;
201
-
202
- /**
203
- * @defaultValue `['dialog']`
204
- */
205
- classes: string[];
206
-
207
- /**
208
- * @defaultValue `'templates/hud/dialog.html'`
209
- */
210
- template: string;
211
-
212
- /**
213
- * Whether to provide jQuery objects to callback functions (if true) or plain
214
- * HTMLElement instances (if false). This is currently true by default but in the
215
- * future will become false by default.
216
- * @defaultValue `true`
217
- */
218
- jQuery: boolean;
219
- }
220
205
  }
221
206
 
222
207
  /**
@@ -266,7 +251,7 @@ interface ConfirmConfig<Yes, No, JQueryOrHtml> {
266
251
  * Additional rendering options passed to the Dialog
267
252
  * @defaultValue `{}`
268
253
  */
269
- options?: Partial<Dialog.Options>;
254
+ options?: Partial<DialogOptions>;
270
255
  }
271
256
 
272
257
  /**
@@ -310,5 +295,5 @@ interface PromptConfig<Value, JQueryOrHtml> {
310
295
  * Additional rendering options
311
296
  * @defaultValue `{}`
312
297
  */
313
- options?: Partial<Dialog.Options>;
298
+ options?: Partial<DialogOptions>;
314
299
  }
@@ -1,12 +1,24 @@
1
1
  /**
2
2
  * Audio/Video Conferencing Configuration Sheet
3
+ *
4
+ * @typeParam Options - The type of the options object
5
+ * @typeParam Data - The data structure used to render the handlebars template.
3
6
  */
4
- declare class AVConfig extends FormApplication<AVConfig.Options, AVConfig.Data, AVMaster> {
7
+ declare class AVConfig<
8
+ Options extends FormApplicationOptions = FormApplicationOptions,
9
+ Data extends object = AVConfig.Data
10
+ > extends FormApplication<Options, Data, AVMaster> {
11
+ /**
12
+ * @param object - The {@link AVMaster} instance being configured.
13
+ * @param options - Application configuration options.
14
+ */
15
+ constructor(object?: AVMaster | undefined, options?: Partial<Options> | undefined);
16
+
5
17
  /** @override */
6
- static get defaultOptions(): AVConfig.Options;
18
+ static get defaultOptions(): FormApplicationOptions;
7
19
 
8
20
  /** @override */
9
- getData(options: Partial<AVConfig.Options>): Promise<AVConfig.Data>;
21
+ getData(options: Partial<Options>): Promise<Data>;
10
22
 
11
23
  /** @override */
12
24
  activateListeners(html: JQuery): void;
@@ -16,6 +28,7 @@ declare class AVConfig extends FormApplication<AVConfig.Options, AVConfig.Data,
16
28
  * @param selector - Selector for the section to enable or disable
17
29
  * @param enabled - Whether to enable or disable this section
18
30
  * (default: true)
31
+ * @internal
19
32
  */
20
33
  protected _setConfigSectionEnabled(selector: string, enabled?: boolean): void;
21
34
 
@@ -24,75 +37,23 @@ declare class AVConfig extends FormApplication<AVConfig.Options, AVConfig.Data,
24
37
  * unavailable since the last time it was set.
25
38
  * @param sources - The available devices
26
39
  * @param source - The selected device
40
+ * @internal
27
41
  */
28
42
  protected _isSourceUnavailable(sources: Record<string, string>, source: string): boolean;
29
43
 
30
- /**
31
- * Callback when the server type changes
32
- * Will enable or disable the server section based on whether the user selected a custom server or not
33
- * @param event - The event that triggered the server type change
34
- */
35
- protected _onServerTypeChanged(event: JQuery.ChangeEvent): void;
36
-
37
44
  /**
38
45
  * Callback when the turn server type changes
39
46
  * Will enable or disable the turn section based on whether the user selected a custom turn or not
40
47
  * @param event - The event that triggered the turn server type change
48
+ * @internal
41
49
  */
42
50
  protected _onTurnTypeChanged(event: JQuery.ChangeEvent): void;
43
51
 
44
- /**
45
- * Handle the assignment of a push-to-talk/push-to-mute key
46
- */
47
- protected _onPTTKeyDown(event: JQuery.KeyDownEvent): void;
48
-
49
- /**
50
- * Handle the assignment of a push-to-talk/push-to-mute mouse key
51
- */
52
- protected _onPTTMouseDown(event: JQuery.MouseDownEvent): void;
53
-
54
52
  /** @override */
55
53
  protected _updateObject(event: Event, formData?: object): Promise<void>;
56
54
  }
57
55
 
58
56
  declare namespace AVConfig {
59
- interface Options extends FormApplicationOptions {
60
- /**
61
- * @defaultValue `game.i18n.localize('WEBRTC.Title')`
62
- */
63
- title: string;
64
-
65
- /**
66
- * @defaultValue `'av-config'`
67
- */
68
- id: string;
69
-
70
- /**
71
- * @defaultValue `'templates/sidebar/apps/av-config.html'`
72
- */
73
- template: string;
74
-
75
- /**
76
- * @defaultValue `true`
77
- */
78
- popOut: boolean;
79
-
80
- /**
81
- * @defaultValue `480`
82
- */
83
- width: number;
84
-
85
- /**
86
- * @defaultValue `'auto'`
87
- */
88
- height: number | 'auto';
89
-
90
- /**
91
- * @defaultValue `[{navSelector: '.tabs', contentSelector: 'form', initial: 'general'}]`
92
- */
93
- tabs: (TabsConfiguration & { contentSelector: string; initial: string })[];
94
- }
95
-
96
57
  interface Data {
97
58
  user: Game['user'];
98
59
  modes: {
@@ -1,13 +1,24 @@
1
+ interface WorldConfigOptions extends FormApplicationOptions {
2
+ /**
3
+ * Whether the world is being created or updated.
4
+ * @defaultValue `false`
5
+ */
6
+ create: boolean;
7
+
8
+ inWorld?: boolean | undefined;
9
+ }
10
+
1
11
  /**
2
12
  * The World Management setup application
3
13
  * @typeParam Options - The type of the options object
4
14
  * @typeParam Data - The data structure used to render the handlebars template.
5
15
  */
6
16
  declare class WorldConfig<
7
- Options extends WorldConfig.Options = WorldConfig.Options,
17
+ Options extends WorldConfigOptions = WorldConfigOptions,
8
18
  Data extends object = WorldConfig.Data
9
19
  > extends FormApplication<Options, Data, Game.WorldData<foundry.packages.WorldData>> {
10
20
  /**
21
+ * @override
11
22
  * @defaultValue
12
23
  * ```typescript
13
24
  * foundry.utils.mergeObject(super.defaultOptions, {
@@ -19,13 +30,16 @@ declare class WorldConfig<
19
30
  * })
20
31
  * ```
21
32
  */
22
- static get defaultOptions(): WorldConfig.Options;
33
+ static get defaultOptions(): WorldConfigOptions;
23
34
 
24
35
  static WORLD_KB_URL: 'https://foundryvtt.com/article/game-worlds/';
25
36
 
26
37
  /** @override */
27
38
  get title(): string;
28
39
 
40
+ /** @override */
41
+ activateListeners(html: JQuery): void;
42
+
29
43
  /** @override */
30
44
  getData(options?: Partial<Options>): Data | Promise<Data>;
31
45
 
@@ -40,8 +54,14 @@ declare class WorldConfig<
40
54
  */
41
55
  protected _updateObject(...args: unknown[]): Promise<unknown>;
42
56
 
57
+ /**
58
+ * Update the world name placeholder when the title is changed.
59
+ * @internal
60
+ */
61
+ protected _onTitleChange(event: JQuery.TriggeredEvent): void;
62
+
43
63
  /** @override **/
44
- activateEditor(name: string, options?: TextEditor.Options, initialContent?: string): void;
64
+ activateEditor(name: string, options?: TextEditor.Options | undefined, initialContent?: string | undefined): void;
45
65
  }
46
66
 
47
67
  declare namespace WorldConfig {
@@ -56,13 +76,4 @@ declare namespace WorldConfig {
56
76
  showEditFields: boolean;
57
77
  systems?: Game.SystemData<foundry.packages.SystemData>[];
58
78
  }
59
-
60
- interface Options extends FormApplicationOptions {
61
- /**
62
- * @defaultValue `false`
63
- */
64
- create: boolean;
65
-
66
- inWorld?: boolean;
67
- }
68
79
  }
@@ -91,7 +91,10 @@ declare global {
91
91
  */
92
92
  protected _onToggleNav(event: JQuery.ClickEvent): void;
93
93
 
94
- static _onLoadProgress(context: string, pct: number): void;
94
+ /**
95
+ * Display progress of some major operation like loading Scene textures.
96
+ */
97
+ static displayProgressBar(options: SceneNavigation.DisplayProgressBarOptions): void;
95
98
  }
96
99
 
97
100
  namespace SceneNavigation {
@@ -104,5 +107,17 @@ declare global {
104
107
  css: string;
105
108
  })[];
106
109
  }
110
+
111
+ interface DisplayProgressBarOptions {
112
+ /**
113
+ * A text label to display
114
+ */
115
+ label?: string | undefined;
116
+
117
+ /**
118
+ * A percentage of progress between 0 and 100
119
+ */
120
+ pct: number;
121
+ }
107
122
  }
108
123
  }
@@ -84,6 +84,13 @@ declare class Sidebar<Options extends ApplicationOptions = ApplicationOptions> e
84
84
  */
85
85
  protected _onChangeTab(event: MouseEvent | null, tabs: Tabs, active: string): void;
86
86
 
87
+ /**
88
+ * Handle the special case of left-clicking a tab when the sidebar is collapsed.
89
+ * @param event - The originating click event
90
+ * @internal
91
+ */
92
+ protected _onLeftClickTab(event: MouseEvent): void;
93
+
87
94
  /**
88
95
  * Handle right-click events on tab controls to trigger pop-out containers for each tab
89
96
  * @param event - The originating contextmenu event
@@ -320,7 +320,7 @@ export declare class ClientDocumentMixin<T extends foundry.abstract.Document<any
320
320
  | (ConstructorDataType<InstanceType<T>['data']> & Record<string, unknown>)
321
321
  >
322
322
  | undefined,
323
- context?: (Pick<DocumentModificationContext, 'parent' | 'pack'> & Partial<Dialog.Options>) | undefined
323
+ context?: (Pick<DocumentModificationContext, 'parent' | 'pack'> & Partial<DialogOptions>) | undefined
324
324
  ): Promise<InstanceType<ConfiguredDocumentClass<T>> | null | undefined>;
325
325
 
326
326
  /**
@@ -329,7 +329,7 @@ export declare class ClientDocumentMixin<T extends foundry.abstract.Document<any
329
329
  * (default: `{}`)
330
330
  * @returns A Promise which resolves to the deleted Document
331
331
  */
332
- deleteDialog(options?: Partial<Dialog.Options> | undefined): Promise<this | false | null | undefined>;
332
+ deleteDialog(options?: Partial<DialogOptions> | undefined): Promise<this | false | null | undefined>;
333
333
 
334
334
  /**
335
335
  * Export document data to a JSON file which can be saved by the client and later imported into a different session.
@@ -224,7 +224,7 @@ declare global {
224
224
  resetDialog(): Promise<InstanceType<ConfiguredDocumentClassForName<'Cards'>> | false | null>;
225
225
 
226
226
  /** @override */
227
- deleteDialog(options?: Partial<Dialog.Options> | undefined): Promise<this | false | null | undefined>;
227
+ deleteDialog(options?: Partial<DialogOptions> | undefined): Promise<this | false | null | undefined>;
228
228
 
229
229
  // TODO: It's a bit weird that we have to do it in this generic way but otherwise there is an error overriding this. Investigate later.
230
230
  /** @override */
@@ -236,7 +236,7 @@ declare global {
236
236
  | (ConstructorDataType<foundry.data.CardsData> & Record<string, unknown>)
237
237
  >
238
238
  | undefined,
239
- context?: (Pick<DocumentModificationContext, 'parent' | 'pack'> & Partial<Dialog.Options>) | undefined
239
+ context?: (Pick<DocumentModificationContext, 'parent' | 'pack'> & Partial<DialogOptions>) | undefined
240
240
  ): Promise<InstanceType<ConfiguredDocumentClass<T>> | null | undefined>;
241
241
  }
242
242
 
@@ -97,7 +97,7 @@ declare global {
97
97
  * (default: `{}`)
98
98
  * @returns A Promise which resolves or rejects once the dialog has been submitted or closed
99
99
  */
100
- exportDialog(pack: string, options?: Dialog.Options): Promise<void>;
100
+ exportDialog(pack: string, options?: DialogOptions): Promise<void>;
101
101
 
102
102
  /**
103
103
  * Get the Folder documents which are sub-folders of the current folder, either direct children or recursively.
@@ -22,13 +22,6 @@ declare global {
22
22
  context?: ConstructorParameters<typeof foundry.documents.BasePlaylist>[1]
23
23
  );
24
24
 
25
- /**
26
- * Each sound which is played within the Playlist has a created Sound instance.
27
- * The keys of this object are the sound IDs and the values are the Sound instances.
28
- * @remarks This seems to be unused and will always be the empty object, see https://gitlab.com/foundrynet/foundryvtt/-/issues/5970
29
- */
30
- audio: {};
31
-
32
25
  /**
33
26
  * Playlists may have a playback order which defines the sequence of Playlist Sounds
34
27
  * @defaultValue `undefined`
@@ -57,7 +50,7 @@ declare global {
57
50
 
58
51
  /**
59
52
  * Begin simultaneous playback for all sounds in the Playlist.
60
- * @returns The updated Playlist entity
53
+ * @returns The updated Playlist document
61
54
  */
62
55
  playAll(): Promise<InstanceType<ConfiguredDocumentClass<typeof Playlist>> | undefined>;
63
56
 
@@ -94,7 +87,7 @@ declare global {
94
87
 
95
88
  /**
96
89
  * End playback for any/all currently playing sounds within the Playlist.
97
- * @returns The updated Playlist entity
90
+ * @returns The updated Playlist document
98
91
  */
99
92
  stopAll(): Promise<InstanceType<ConfiguredDocumentClass<typeof Playlist>> | undefined>;
100
93
 
@@ -187,10 +180,10 @@ declare global {
187
180
  _onSoundStart(sound: InstanceType<ConfiguredDocumentClass<typeof PlaylistSound>>): Promise<void>;
188
181
 
189
182
  /** @override */
190
- toCompendium(pack?: CompendiumCollection<CompendiumCollection.Metadata>): Omit<
191
- foundry.data.PlaylistData['_source'],
192
- '_id' | 'folder' | 'permission'
193
- > & {
183
+ toCompendium(
184
+ pack?: CompendiumCollection<CompendiumCollection.Metadata> | null | undefined,
185
+ options?: ClientDocumentMixin.CompendiumExportOptions | undefined
186
+ ): Omit<foundry.data.PlaylistData['_source'], '_id' | 'folder' | 'permission'> & {
194
187
  permission?: foundry.data.PlaylistData['_source']['permission'];
195
188
  };
196
189
  }
@@ -169,7 +169,7 @@ declare global {
169
169
  * null if the dialog was closed without making a choice.
170
170
  */
171
171
  importDialog(
172
- options?: Dialog.Options | undefined
172
+ options?: DialogOptions | undefined
173
173
  ): Promise<StoredDocument<DocumentInstanceForCompendiumMetadata<T>>[] | null | false>;
174
174
 
175
175
  /**
@@ -7,6 +7,23 @@ declare class HandlebarsHelpers {
7
7
  */
8
8
  static checked(value: unknown): string;
9
9
 
10
+ /**
11
+ * For use in form inputs. If the supplied value is truthy, add the "disabled" property, otherwise add nothing.
12
+ */
13
+ static disabled(value: unknown): string;
14
+
15
+ /**
16
+ * Concatenate a number of string terms into a single string.
17
+ * This is useful for passing arguments with variable names.
18
+ * @param values - The values to concatenate
19
+ *
20
+ * @example <caption>Concatenate several string parts to create a dynamic variable</caption>
21
+ * ```handlebars
22
+ * {{filePicker target=(concat "faces." i ".img") type="image"}}
23
+ * ```
24
+ */
25
+ static concat(...values: string[]): Handlebars.SafeString;
26
+
10
27
  /**
11
28
  * Render a pair of inputs for selecting a color.
12
29
  * @param options - Helper options
@@ -31,12 +48,15 @@ declare class HandlebarsHelpers {
31
48
  * @example <caption>Translate a provided localization string, optionally including formatting parameters</caption>
32
49
  * ```handlebars
33
50
  * <label>{{localize "ACTOR.Create"}}</label> <!-- "Create Actor" -->
34
- * <label>{{localize "CHAT.InvalidCommand", command=foo}}</label> <!-- "foo is not a valid chat message command." -->
51
+ * <label>{{localize "CHAT.InvalidCommand" command=foo}}</label> <!-- "foo is not a valid chat message command." -->
35
52
  * ```
36
53
  */
37
54
  static localize(value: string, options: HandlebarsHelpers.LocalizeOptions): string;
38
55
 
39
56
  /**
57
+ * @param value - A numeric value to format
58
+ * @param options - Additional options which customize the resulting format
59
+ * @returns The formatted string to be included in a template
40
60
  * A string formatting helper to display a number with a certain fixed number of decimals and an explicit sign.
41
61
  */
42
62
  static numberFormat(value: string, options: HandlebarsHelpers.NumberFormatOptions): string;
@@ -78,7 +98,7 @@ declare class HandlebarsHelpers {
78
98
  ): Handlebars.SafeString;
79
99
 
80
100
  /**
81
- * Render a pair of inputs for selecting a color.
101
+ * Render a pair of inputs for selecting a value in a range.
82
102
  * @param options - Helper options
83
103
  */
84
104
  static rangePicker(options: HandlebarsHelpers.RangePickerOptions): Handlebars.SafeString;
@@ -206,10 +226,10 @@ declare namespace HandlebarsHelpers {
206
226
  editable?: boolean;
207
227
 
208
228
  /**
209
- * Replace dynamic entity links?
229
+ * Replace dynamic document links?
210
230
  * @defaultValue `true`
211
231
  */
212
- entities?: boolean;
232
+ documents?: boolean;
213
233
 
214
234
  /**
215
235
  * The data object providing context for inline rolls
@@ -245,11 +265,13 @@ declare namespace HandlebarsHelpers {
245
265
  interface NumberFormatOptions extends Handlebars.HelperOptions {
246
266
  hash: {
247
267
  /**
268
+ * The number of decimal places to include in the resulting string
248
269
  * @defaultValue `0`
249
270
  */
250
271
  decimals?: number;
251
272
 
252
273
  /**
274
+ * Whether to include an explicit "+" sign for positive numbers
253
275
  * @defaultValue `false`
254
276
  */
255
277
  sign?: boolean;
@@ -96,7 +96,7 @@ declare class MouseInteractionManager<Object extends PIXI.Container = PIXI.Conta
96
96
 
97
97
  /**
98
98
  * The throttling time below which a mouse move event will not be handled
99
- * @defaultValue `Math.ceil(1000 / canvas.app.ticker.maxFPS)`
99
+ * @defaultValue `Math.ceil(1000 / (canvas.app.ticker.maxFPS || 60));`
100
100
  * @internal
101
101
  */
102
102
  protected _dragThrottleMS: number;
@@ -92,7 +92,7 @@ declare namespace PerceptionManager {
92
92
  sight: {
93
93
  initialize: boolean;
94
94
  refresh: boolean;
95
- noUpdateFog: boolean;
95
+ skipUpdateFog: boolean;
96
96
  forceUpdateFog: boolean;
97
97
  };
98
98
  sounds: {
@@ -11,7 +11,7 @@ declare global {
11
11
  /**
12
12
  * A reference to the PointSource object which defines this light source area of effect
13
13
  */
14
- source: PointSource;
14
+ source: LightSource;
15
15
 
16
16
  /**
17
17
  * A reference to the ControlIcon used to configure this light
@@ -25,6 +25,11 @@ declare global {
25
25
  /** @override */
26
26
  get bounds(): NormalizedRectangle;
27
27
 
28
+ /**
29
+ * A convenience accessor to the LightData configuration object
30
+ */
31
+ get config(): foundry.data.LightData;
32
+
28
33
  /**
29
34
  * Test whether a specific AmbientLight source provides global illumination
30
35
  */
@@ -53,6 +58,9 @@ declare global {
53
58
  /** @override */
54
59
  draw(): Promise<this>;
55
60
 
61
+ /** @override */
62
+ destroy(options?: Parameters<PlaceableObject['destroy']>[0]): void;
63
+
56
64
  /**
57
65
  * Draw the ControlIcon for the AmbientLight
58
66
  * @internal
@@ -74,12 +82,9 @@ declare global {
74
82
 
75
83
  /**
76
84
  * Update the source object associated with this light
77
- * @param defer - Defer refreshing the LightingLayer to manually call that refresh later.
78
- * (default: `false`)
79
- * @param deleted - Indicate that this light source has been deleted.
80
- * (default: `false`)
85
+ * @param options - (default: `{}}`)
81
86
  */
82
- updateSource({ defer, deleted }?: { defer?: boolean; deleted?: boolean }): null | void;
87
+ updateSource(options?: AmbientLight.UpdateSourceOptions | undefined): void;
83
88
 
84
89
  /** @override */
85
90
  protected _onCreate(
@@ -116,4 +121,20 @@ declare global {
116
121
  /** @override */
117
122
  protected _onDragLeftCancel(event: MouseEvent): void;
118
123
  }
124
+
125
+ namespace AmbientLight {
126
+ interface UpdateSourceOptions {
127
+ /**
128
+ * Defer refreshing the LightingLayer to manually call that refresh later.
129
+ * @defaultValue `false`
130
+ */
131
+ defer?: boolean | undefined;
132
+
133
+ /**
134
+ * Indicate that this light source has been deleted.
135
+ * @defaultValue `false`
136
+ */
137
+ deleted?: boolean | undefined;
138
+ }
139
+ }
119
140
  }
@@ -13,6 +13,11 @@ declare global {
13
13
  */
14
14
  sound: Sound | null;
15
15
 
16
+ /**
17
+ * A SoundSource object which manages the area of effect for this ambient sound
18
+ */
19
+ source: SoundSource;
20
+
16
21
  /** @override */
17
22
  static embeddedName: 'AmbientSound';
18
23
 
@@ -31,9 +36,9 @@ declare global {
31
36
  get bounds(): Rectangle;
32
37
 
33
38
  /**
34
- * A convenience accessor for the sound type
39
+ * The named identified for the source object associated with this ambient sound
35
40
  */
36
- get type(): 'l' | 'g';
41
+ get sourceId(): string;
37
42
 
38
43
  /**
39
44
  * A convenience accessor for the sound radius in pixels
@@ -54,6 +59,9 @@ declare global {
54
59
  /** @override */
55
60
  draw(): Promise<this>;
56
61
 
62
+ /** @override */
63
+ destroy(options?: Parameters<PlaceableObject['destroy']>[0]): void;
64
+
57
65
  /**
58
66
  * Draw the graphical preview of the audio source area of effect
59
67
  * @internal
@@ -76,9 +84,9 @@ declare global {
76
84
 
77
85
  /**
78
86
  * Compute the field-of-vision for an object, determining its effective line-of-sight and field-of-vision polygons
79
- * @returns An object containing the rays, LOS polygon, and FOV polygon for the light
87
+ * @param options - (default: `{}`)
80
88
  */
81
- updateSource(): { rays: null; los: null; fov: PIXI.Circle } | ReturnType<WallsLayer['computePolygon']>;
89
+ updateSource(options?: AmbientSound.UpdateSourceOptions | undefined): void;
82
90
 
83
91
  /** @override */
84
92
  protected _onCreate(
@@ -118,5 +126,19 @@ declare global {
118
126
  */
119
127
  fade: number;
120
128
  }
129
+
130
+ interface UpdateSourceOptions {
131
+ /**
132
+ * Defer refreshing the SoundsLayer to manually call that refresh later.
133
+ * @defaultValue `false`
134
+ */
135
+ defer?: boolean | undefined;
136
+
137
+ /**
138
+ * Indicate that this SoundSource has been deleted.
139
+ * @defaultValue `false`
140
+ */
141
+ deleted?: boolean | undefined;
142
+ }
121
143
  }
122
144
  }
@@ -1,4 +1,4 @@
1
- import { ConfiguredDocumentClass } from '../../../../../types/helperTypes';
1
+ import { ConfiguredDocumentClass, ConfiguredDocumentClassForName } from '../../../../../types/helperTypes';
2
2
  import { DocumentModificationOptions } from '../../../../common/abstract/document.mjs';
3
3
 
4
4
  declare global {
@@ -40,18 +40,25 @@ declare global {
40
40
  /**
41
41
  * Internal timestamp for the previous freehand draw time, to limit sampling
42
42
  * @defaultValue `0`
43
+ * @internal
43
44
  */
44
45
  protected _drawTime: number;
46
+
47
+ /**
48
+ * @defaultValue `0`
49
+ * @internal
50
+ */
45
51
  protected _sampleTime: number;
46
52
 
47
53
  /**
48
54
  * Internal flag for the permanent points of the polygon
49
55
  * @defaultValue `foundry.utils.deepClone(this.data.points || [])`
56
+ * @internal
50
57
  */
51
58
  protected _fixedPoints: Array<[x: number, y: number]>;
52
59
 
53
60
  /** @override */
54
- static get embeddedName(): 'Drawing';
61
+ static embeddedName: 'Drawing';
55
62
 
56
63
  /**
57
64
  * The rate at which points are sampled (in milliseconds) during a freehand drawing workflow
@@ -77,6 +84,7 @@ declare global {
77
84
 
78
85
  /**
79
86
  * Clean the drawing data to constrain its allowed position
87
+ * @internal
80
88
  */
81
89
  protected _cleanData(): void;
82
90
 
@@ -87,11 +95,13 @@ declare global {
87
95
 
88
96
  /**
89
97
  * Create elements for the foreground text
98
+ * @internal
90
99
  */
91
100
  protected _createText(): PreciseText;
92
101
 
93
102
  /**
94
103
  * Create elements for the Drawing border and handles
104
+ * @internal
95
105
  */
96
106
  protected _createFrame(): void;
97
107
 
@@ -100,21 +110,25 @@ declare global {
100
110
 
101
111
  /**
102
112
  * Draw rectangular shapes
113
+ * @internal
103
114
  */
104
115
  protected _drawRectangle(): void;
105
116
 
106
117
  /**
107
118
  * Draw ellipsoid shapes
119
+ * @internal
108
120
  */
109
121
  protected _drawEllipse(): void;
110
122
 
111
123
  /**
112
124
  * Draw polygonal shapes
125
+ * @internal
113
126
  */
114
127
  protected _drawPolygon(): void;
115
128
 
116
129
  /**
117
130
  * Draw freehand shapes with bezier spline smoothing
131
+ * @internal
118
132
  */
119
133
  protected _drawFreehand(): void;
120
134
 
@@ -125,6 +139,7 @@ declare global {
125
139
  * @param previous - The prior point
126
140
  * @param point - The current point
127
141
  * @param next - The next point
142
+ * @internal
128
143
  */
129
144
  protected _getBezierControlPoints(
130
145
  factor: number,
@@ -144,17 +159,20 @@ declare global {
144
159
 
145
160
  /**
146
161
  * Refresh the boundary frame which outlines the Drawing shape
162
+ * @internal
147
163
  */
148
164
  protected _refreshFrame({ x, y, width, height }: Rectangle): void;
149
165
 
150
166
  /**
151
167
  * Add a new polygon point to the drawing, ensuring it differs from the last one
152
168
  * @param temporary - (default: `true`)
169
+ * @internal
153
170
  */
154
171
  protected _addPoint(position: Point, temporary?: boolean): void;
155
172
 
156
173
  /**
157
174
  * Remove the last fixed point from the polygon
175
+ * @internal
158
176
  */
159
177
  protected _removePoint(): void;
160
178
 
@@ -169,13 +187,9 @@ declare global {
169
187
 
170
188
  /**
171
189
  * Handle text entry in an active text tool
190
+ * @internal
172
191
  */
173
- protected _onDrawingTextKeydown(
174
- event: KeyboardEvent
175
- ):
176
- | ReturnType<InstanceType<ConfiguredDocumentClass<typeof DrawingDocument>>['update']>
177
- | ReturnType<InstanceType<ConfiguredDocumentClass<typeof DrawingDocument>>['delete']>
178
- | void;
192
+ protected _onDrawingTextKeydown(event: KeyboardEvent): void;
179
193
 
180
194
  /** @override */
181
195
  protected _onUpdate(data: DeepPartial<foundry.data.DrawingData['_source']>): void;
@@ -184,20 +198,21 @@ declare global {
184
198
  * @override
185
199
  * @param event - unused
186
200
  */
187
- protected _canControl(user: User, event?: any): boolean;
201
+ protected _canControl(user: InstanceType<ConfiguredDocumentClassForName<'User'>>, event?: any): boolean;
188
202
 
189
203
  /**
190
204
  * @override
191
205
  * @param user - unused
192
206
  * @param event - unused
193
207
  */
194
- protected _canConfigure(user: User, event?: any): boolean;
208
+ protected _canConfigure(user: InstanceType<ConfiguredDocumentClassForName<'User'>>, event?: any): boolean;
195
209
 
196
210
  /** @override */
197
211
  activateListeners(): void;
198
212
 
199
213
  /**
200
214
  * Handle mouse movement which modifies the dimensions of the drawn shape
215
+ * @internal
201
216
  */
202
217
  protected _onMouseDraw(event: PIXI.InteractionEvent): void;
203
218
 
@@ -216,35 +231,41 @@ declare global {
216
231
  /**
217
232
  * Handle mouse-over event on a control handle
218
233
  * @param event - The mouseover event
234
+ * @internal
219
235
  */
220
236
  protected _onHandleHoverIn(event: PIXI.InteractionEvent): void;
221
237
 
222
238
  /**
223
239
  * Handle mouse-out event on a control handle
224
240
  * @param event - The mouseout event
241
+ * @internal
225
242
  */
226
243
  protected _onHandleHoverOut(event: PIXI.InteractionEvent): void;
227
244
 
228
245
  /**
229
246
  * When we start a drag event - create a preview copy of the Tile for re-positioning
230
247
  * @param event - The mousedown event
248
+ * @internal
231
249
  */
232
250
  protected _onHandleMouseDown(event: PIXI.InteractionEvent): void;
233
251
 
234
252
  /**
235
253
  * Handle the beginning of a drag event on a resize handle
254
+ * @internal
236
255
  */
237
256
  protected _onHandleDragStart(event: PIXI.InteractionEvent): void;
238
257
 
239
258
  /**
240
259
  * Handle mousemove while dragging a tile scale handler
241
260
  * @param event - The mousemove event
261
+ * @internal
242
262
  */
243
263
  protected _onHandleDragMove(event: PIXI.InteractionEvent): void;
244
264
 
245
265
  /**
246
266
  * Handle mouseup after dragging a tile scale handler
247
267
  * @param event - The mouseup event
268
+ * @internal
248
269
  */
249
270
  protected _onHandleDragDrop(
250
271
  event: PIXI.InteractionEvent
@@ -252,6 +273,7 @@ declare global {
252
273
 
253
274
  /**
254
275
  * Handle cancellation of a drag event for one of the resizing handles
276
+ * @internal
255
277
  */
256
278
  protected _onHandleDragCancel(event: PIXI.InteractionEvent): void;
257
279
 
@@ -260,6 +282,7 @@ declare global {
260
282
  * @param original - The original drawing data
261
283
  * @param dx - The pixel distance dragged in the horizontal direction
262
284
  * @param dy - The pixel distance dragged in the vertical direction
285
+ * @internal
263
286
  */
264
287
  protected _rescaleDimensions(
265
288
  original: Pick<foundry.data.DrawingData['_source'], 'x' | 'y' | 'points' | 'width' | 'height'>,
@@ -272,19 +295,10 @@ declare global {
272
295
  * @param data - The Drawing data pending update
273
296
  * @returns The adjusted data
274
297
  * @remarks This is intentionally public because it is called by the DrawingsLayer
298
+ * @internal
275
299
  */
276
300
  static normalizeShape(
277
301
  data: Pick<foundry.data.DrawingData['_source'], 'x' | 'y' | 'width' | 'height' | 'points'>
278
302
  ): Pick<foundry.data.DrawingData['_source'], 'x' | 'y' | 'width' | 'height' | 'points'>;
279
-
280
- /**
281
- * @deprecated since 0.8.0
282
- */
283
- get author(): InstanceType<ConfiguredDocumentClass<typeof User>>;
284
-
285
- /**
286
- * @deprecated since 0.8.0
287
- */
288
- get owner(): boolean;
289
303
  }
290
304
  }
@@ -4,11 +4,11 @@ import { HoverInOptions } from '../placeableObject';
4
4
  declare global {
5
5
  /**
6
6
  * A Note is an implementation of PlaceableObject which represents an annotated location within the Scene.
7
- * Each Note links to a JournalEntry entity and represents it's location on the map.
7
+ * Each Note links to a JournalEntry document and represents its location on the map.
8
8
  */
9
9
  class Note extends PlaceableObject<InstanceType<ConfiguredDocumentClass<typeof NoteDocument>>> {
10
10
  /** @override */
11
- static get embeddedName(): 'Note';
11
+ static embeddedName: 'Note';
12
12
 
13
13
  /** @override */
14
14
  get bounds(): Rectangle;
@@ -28,6 +28,13 @@ declare global {
28
28
  */
29
29
  get size(): number;
30
30
 
31
+ /**
32
+ * Determine whether the Note is visible to the current user based on their perspective of the Scene.
33
+ * Visibility depends on permission to the underlying journal entry, as well as the perspective of controlled Tokens.
34
+ * If Token Vision is required, the user must have a token with vision over the note to see it.
35
+ */
36
+ get isVisible(): boolean;
37
+
31
38
  /** @override */
32
39
  draw(): Promise<this>;
33
40
 
@@ -36,6 +36,12 @@ declare global {
36
36
  */
37
37
  tile: PIXI.Sprite | undefined;
38
38
 
39
+ /**
40
+ * The occlusion image sprite
41
+ * @defaultValue `undefined`
42
+ */
43
+ occlusionTile: PIXI.Sprite | undefined;
44
+
39
45
  /**
40
46
  * A Tile background which is displayed if no valid image texture is present
41
47
  * @defaultValue `undefined`
@@ -94,7 +100,12 @@ declare global {
94
100
  draw(): Promise<this>;
95
101
 
96
102
  /** @override */
97
- refresh(): this;
103
+ destroy(options?: Parameters<PlaceableObject['destroy']>[0]): void;
104
+
105
+ /**
106
+ * @param options - (default: `{}`)
107
+ * @override */
108
+ refresh(options?: Tile.RefreshOptions | undefined): this;
98
109
 
99
110
  /**
100
111
  * Refresh the display of the Tile border
@@ -114,7 +125,14 @@ declare global {
114
125
  * @param options - Additional options for modifying video playback
115
126
  * (default: `{}`)
116
127
  */
117
- play(playing: boolean, options?: Partial<Tile.PlayOptions>): void;
128
+ play(playing: boolean, options?: Tile.PlayOptions | undefined): void;
129
+
130
+ /**
131
+ * Unlink the playback of this video tile from the playback of other tokens which are using the same base texture.
132
+ * @param source - The video element source
133
+ * @internal
134
+ */
135
+ protected _unlinkVideoPlayback(source: HTMLVideoElement): Promise<void>;
118
136
 
119
137
  /**
120
138
  * Update the occlusion rendering for this overhead Tile for a given controlled Token.
@@ -131,7 +149,7 @@ declare global {
131
149
  */
132
150
  testOcclusion(
133
151
  token: InstanceType<ConfiguredObjectClassForName<'Token'>>,
134
- options?: Partial<Tile.OcclusionOptions>
152
+ options?: Tile.OcclusionOptions | undefined
135
153
  ): boolean;
136
154
 
137
155
  /**
@@ -157,7 +175,7 @@ declare global {
157
175
  * @param options - Options which customize the return value
158
176
  * @internal
159
177
  */
160
- protected _createAlphaMap(options: Partial<Tile.AlphaMapOptions>): Exclude<Tile['_alphaMap'], undefined>;
178
+ protected _createAlphaMap(options: Tile.AlphaMapOptions): Exclude<Tile['_alphaMap'], undefined>;
161
179
 
162
180
  /**
163
181
  * Compute the alpha-based bounding box for the tile, including an angle of rotation.
@@ -242,7 +260,7 @@ declare global {
242
260
  * Get resized Tile dimensions
243
261
  * @internal
244
262
  */
245
- protected _getResizedDimensions(event: MouseEvent, origin: Point, destination: Point): NormalizedRectangle;
263
+ protected _getResizedDimensions(event: MouseEvent, origin: Point, destination: Point): Rectangle;
246
264
 
247
265
  /**
248
266
  * Handle cancellation of a drag event for one of the resizing handles
@@ -251,18 +269,27 @@ declare global {
251
269
 
252
270
  /**
253
271
  * Create a preview tile with a background texture instead of an image
272
+ * @param data - Initial data with which to create the preview Tile
254
273
  */
255
- static createPreview(data: TileDataConstructorData): Tile;
274
+ static createPreview(data: TileDataConstructorData): InstanceType<ConfiguredObjectClassForName<'Tile'>>;
256
275
  }
257
276
 
258
277
  namespace Tile {
278
+ interface RefreshOptions {
279
+ /**
280
+ * Also refresh the perception layer.
281
+ * @defaultValue `false`
282
+ */
283
+ refreshPerception?: boolean | undefined;
284
+ }
285
+
259
286
  interface PlayOptions {
260
287
  /** Should the video loop? */
261
- loop: boolean;
288
+ loop?: boolean | undefined;
262
289
  /** A specific timestamp between 0 and the video duration to begin playback */
263
- offset: number;
290
+ offset?: number | undefined;
264
291
  /** Desired volume level of the video's audio channel (if any) */
265
- volume: number;
292
+ volume?: number | undefined;
266
293
  }
267
294
 
268
295
  interface OcclusionOptions {
@@ -270,7 +297,7 @@ declare global {
270
297
  * Test corners of the hit-box in addition to the token center?
271
298
  * @defaultValue `true`
272
299
  */
273
- corners: boolean;
300
+ corners?: boolean | undefined;
274
301
  }
275
302
 
276
303
  interface AlphaMapOptions {
@@ -278,13 +305,13 @@ declare global {
278
305
  * Keep the Uint8Array of pixel alphas?
279
306
  * @defaultValue `false`
280
307
  */
281
- keepPixels: boolean;
308
+ keepPixels?: boolean | undefined;
282
309
 
283
310
  /**
284
311
  * Keep the pure white RenderTexture?
285
312
  * @defaultValue `false`
286
313
  */
287
- keepTexture: boolean;
314
+ keepTexture?: boolean | undefined;
288
315
  }
289
316
  }
290
317
  }