@league-of-foundry-developers/foundry-vtt-types 9.249.4 → 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/README.md +1 -1
- package/package.json +2 -2
- package/src/foundry/common/constants.mjs.d.ts +1 -0
- package/src/foundry/common/documents.mjs/baseMacro.d.ts +0 -3
- package/src/foundry/common/documents.mjs/baseMeasuredTemplate.d.ts +8 -1
- package/src/foundry/common/packages.mjs/packageCompendiumData.d.ts +7 -1
- package/src/foundry/common/types.mjs.d.ts +125 -10
- package/src/foundry/common/utils/helpers.mjs.d.ts +0 -1
- package/src/foundry/common/utils/http.mjs.d.ts +52 -0
- package/src/foundry/common/utils/module.mjs.d.ts +1 -0
- package/src/foundry/common/utils/primitives.mjs.d.ts +2 -2
- package/src/foundry/common/utils/semaphore.mjs.d.ts +6 -3
- package/src/foundry/foundry.js/applications/dialog.d.ts +14 -29
- package/src/foundry/foundry.js/applications/formApplications/avConfig.d.ts +18 -57
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +8 -6
- package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +4 -4
- package/src/foundry/foundry.js/applications/formApplications/worldConfig.d.ts +23 -12
- package/src/foundry/foundry.js/applications/notifications.d.ts +2 -5
- package/src/foundry/foundry.js/applications/sceneNavigation.d.ts +16 -1
- package/src/foundry/foundry.js/applications/sidebar.d.ts +7 -0
- package/src/foundry/foundry.js/avClient.d.ts +15 -1
- package/src/foundry/foundry.js/avClients/index.d.ts +0 -1
- package/src/foundry/foundry.js/avClients/simplePeerAVClient.d.ts +31 -4
- package/src/foundry/foundry.js/avMaster.d.ts +21 -48
- package/src/foundry/foundry.js/avSettings.d.ts +19 -46
- package/src/foundry/foundry.js/canvas.d.ts +0 -8
- package/src/foundry/foundry.js/clientDatabaseBackend.d.ts +6 -0
- package/src/foundry/foundry.js/clientDocumentMixin.d.ts +4 -4
- package/src/foundry/foundry.js/clientDocuments/activeEffect.d.ts +28 -6
- package/src/foundry/foundry.js/clientDocuments/actor.d.ts +13 -70
- package/src/foundry/foundry.js/clientDocuments/canvasDocuments/tokenDocument.d.ts +42 -9
- package/src/foundry/foundry.js/clientDocuments/cards.d.ts +4 -3
- package/src/foundry/foundry.js/clientDocuments/folder.d.ts +23 -21
- package/src/foundry/foundry.js/clientDocuments/item.d.ts +5 -23
- package/src/foundry/foundry.js/clientDocuments/macro.d.ts +10 -0
- package/src/foundry/foundry.js/clientDocuments/playlist.d.ts +6 -13
- package/src/foundry/foundry.js/clientDocuments/playlistSound.d.ts +1 -1
- package/src/foundry/foundry.js/clientDocuments/prototypeToken.d.ts +24 -14
- package/src/foundry/foundry.js/clientDocuments/rollTable.d.ts +16 -14
- package/src/foundry/foundry.js/clientDocuments/scene.d.ts +12 -7
- package/src/foundry/foundry.js/clientDocuments/user.d.ts +2 -12
- package/src/foundry/foundry.js/clientSettings.d.ts +203 -230
- package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +4 -2
- package/src/foundry/foundry.js/config.d.ts +3 -0
- package/src/foundry/foundry.js/game.d.ts +1 -1
- package/src/foundry/foundry.js/gamepadManager.d.ts +12 -0
- package/src/foundry/foundry.js/globalVariables.d.ts +0 -31
- package/src/foundry/foundry.js/handlebarsHelpers.d.ts +26 -4
- package/src/foundry/foundry.js/mouseInteractionManager.d.ts +1 -1
- package/src/foundry/foundry.js/perceptionManager.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/containers/baseGrid.d.ts +21 -6
- package/src/foundry/foundry.js/pixi/containers/baseGrids/hexagonalGrid.d.ts +13 -8
- package/src/foundry/foundry.js/pixi/containers/baseGrids/squareGrid.d.ts +5 -3
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/gridLayer.d.ts +14 -5
- package/src/foundry/foundry.js/pixi/containers/placeableObject.d.ts +9 -55
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientLight.d.ts +27 -6
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientSound.d.ts +29 -4
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/drawing.d.ts +37 -20
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/measuredTemplate.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/note.d.ts +12 -2
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/tile.d.ts +42 -12
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygon.d.ts +4 -2
- package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygons/clockwiseSweepPolygon.d.ts +31 -17
- package/src/foundry/foundry.js/rollTerms/diceTerms/die.d.ts +0 -5
- package/src/foundry/foundry.js/rollTerms/diceTerms/fateDie.d.ts +21 -1
- package/src/foundry/foundry.js/videoHelper.d.ts +0 -7
- package/src/foundry/index.d.ts +0 -4
- package/src/types/helperTypes.d.ts +6 -0
- package/src/foundry/foundry.js/avClients/easyRTCClient.d.ts +0 -392
- package/src/foundry/foundry.js/features.d.ts +0 -0
- package/src/foundry/foundry.js/fonts.d.ts +0 -24
package/README.md
CHANGED
@@ -17,7 +17,7 @@ TypeScript type definitions for [Foundry Virtual Tabletop](https://foundryvtt.co
|
|
17
17
|
|
18
18
|
We aim to support the latest release of each Foundry VTT version (0.7, 0.8, 9, etc.), starting with 0.7.
|
19
19
|
|
20
|
-
At the moment, both version 0.7 and 0.8 are fully supported. Version 9 is already partially supported, but there is still a lot to be done. See https://github.com/League-of-Foundry-Developers/foundry-vtt-types/issues?q=is%3Aopen+is%3Aissue+label%3A%22foundry+V9%22 to keep track of the progress.
|
20
|
+
At the moment, both version 0.7 and 0.8 are fully supported. Version 9 is already partially supported, but there is still a lot to be done. See the [open foundry V9 issues](https://github.com/League-of-Foundry-Developers/foundry-vtt-types/issues?q=is%3Aopen+is%3Aissue+label%3A%22foundry+V9%22) to keep track of the progress.
|
21
21
|
|
22
22
|
|
23
23
|
## Installation
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@league-of-foundry-developers/foundry-vtt-types",
|
3
|
-
"version": "9.
|
3
|
+
"version": "9.255.2",
|
4
4
|
"description": "TypeScript type definitions for Foundry VTT",
|
5
5
|
"exports": {
|
6
6
|
".": {
|
@@ -74,7 +74,7 @@
|
|
74
74
|
"lint-staged": "^12.1.2",
|
75
75
|
"prettier": "^2.5.1",
|
76
76
|
"tsd": "^0.19.1",
|
77
|
-
"typescript": "~4.
|
77
|
+
"typescript": "~4.6.2"
|
78
78
|
},
|
79
79
|
"husky": {
|
80
80
|
"hooks": {
|
@@ -16,9 +16,6 @@ type MacroMetadata = Merge<
|
|
16
16
|
types: [typeof CONST.MACRO_TYPES.SCRIPT, typeof CONST.MACRO_TYPES.CHAT];
|
17
17
|
permissions: {
|
18
18
|
create: 'PLAYER';
|
19
|
-
// TODO: fix when fixed by foundry (https://gitlab.com/foundrynet/foundryvtt/-/issues/6694)
|
20
|
-
// update: undefined;
|
21
|
-
// delete: undefined;
|
22
19
|
};
|
23
20
|
}
|
24
21
|
>;
|
@@ -15,7 +15,7 @@ type MeasuredTemplateMetadata = Merge<
|
|
15
15
|
labelPlural: 'DOCUMENT.MeasuredTemplates';
|
16
16
|
isEmbedded: true;
|
17
17
|
permissions: {
|
18
|
-
create:
|
18
|
+
create: (user: BaseUser, doc: BaseMeasuredTemplate) => boolean;
|
19
19
|
update: (
|
20
20
|
user: BaseUser,
|
21
21
|
doc: BaseMeasuredTemplate,
|
@@ -51,6 +51,13 @@ export declare class BaseMeasuredTemplate extends Document<
|
|
51
51
|
{ exact }?: { exact?: boolean }
|
52
52
|
): boolean;
|
53
53
|
|
54
|
+
/**
|
55
|
+
* Is a user able to create a new MeasuredTemplate?
|
56
|
+
* @param user - The user attempting the creation operation.
|
57
|
+
* @param doc - The MeasuredTemplate being created.
|
58
|
+
*/
|
59
|
+
protected static _canCreate(user: BaseUser, doc: BaseMeasuredTemplate): boolean;
|
60
|
+
|
54
61
|
/**
|
55
62
|
* Is a user able to modify an existing MeasuredTemplate?
|
56
63
|
*/
|
@@ -3,7 +3,13 @@ import { DocumentData } from '../abstract/module.mjs';
|
|
3
3
|
import * as fields from '../data/fields.mjs';
|
4
4
|
|
5
5
|
interface PackageCompendiumDataSchema extends DocumentSchema {
|
6
|
-
name:
|
6
|
+
name: FieldReturnType<
|
7
|
+
fields.RequiredString,
|
8
|
+
{
|
9
|
+
validate: (v: string) => boolean;
|
10
|
+
validationError: "Invalid compendium name '{value}'. Compendium names cannot contain dots.";
|
11
|
+
}
|
12
|
+
>;
|
7
13
|
label: fields.RequiredString;
|
8
14
|
path: fields.RequiredString;
|
9
15
|
private: FieldReturnType<fields.BooleanField, { default: false }>;
|
@@ -1,17 +1,17 @@
|
|
1
1
|
/**
|
2
2
|
* A single point, expressed as an object \{x, y\}
|
3
3
|
*/
|
4
|
-
|
4
|
+
type Point = PIXI.Point | { x: number; y: number };
|
5
5
|
|
6
6
|
/**
|
7
7
|
* A single point, expressed as an array \[x,y\]
|
8
8
|
*/
|
9
|
-
|
9
|
+
type PointArray = [x: number, y: number];
|
10
10
|
|
11
11
|
/**
|
12
12
|
* A standard rectangle interface.
|
13
13
|
*/
|
14
|
-
|
14
|
+
type Rectangle =
|
15
15
|
| PIXI.Rectangle
|
16
16
|
| {
|
17
17
|
x: number;
|
@@ -20,8 +20,92 @@ declare type Rectangle =
|
|
20
20
|
height: number;
|
21
21
|
};
|
22
22
|
|
23
|
+
/** A Client Setting */
|
24
|
+
interface SettingConfig<T = unknown> {
|
25
|
+
/** A unique machine-readable id for the setting */
|
26
|
+
key: string;
|
27
|
+
|
28
|
+
/** The namespace the setting belongs to */
|
29
|
+
namespace: string;
|
30
|
+
|
31
|
+
/** The human readable name */
|
32
|
+
name?: string | undefined;
|
33
|
+
|
34
|
+
/** An additional human readable hint */
|
35
|
+
hint?: string | undefined;
|
36
|
+
|
37
|
+
/**
|
38
|
+
* The scope the Setting is stored in, either World or Client
|
39
|
+
* @defaultValue `'client'`
|
40
|
+
*/
|
41
|
+
scope: 'world' | 'client';
|
42
|
+
|
43
|
+
/** Indicates if this Setting should render in the Config application */
|
44
|
+
config?: boolean | undefined;
|
45
|
+
|
46
|
+
/** The JS Type that the Setting is storing */
|
47
|
+
type?: T extends string
|
48
|
+
? typeof String
|
49
|
+
: T extends number
|
50
|
+
? typeof Number
|
51
|
+
: T extends boolean
|
52
|
+
? typeof Boolean
|
53
|
+
: T extends Array<any>
|
54
|
+
? typeof Array
|
55
|
+
: ConstructorOf<T>;
|
56
|
+
|
57
|
+
/** For string Types, defines the allowable values */
|
58
|
+
choices?: (T extends string ? Record<string, string> : never) | undefined;
|
59
|
+
|
60
|
+
/** For numeric Types, defines the allowable range */
|
61
|
+
range?:
|
62
|
+
| (T extends number
|
63
|
+
? {
|
64
|
+
max: number;
|
65
|
+
min: number;
|
66
|
+
step: number;
|
67
|
+
}
|
68
|
+
: never)
|
69
|
+
| undefined;
|
70
|
+
|
71
|
+
/** The default value */
|
72
|
+
default?: T;
|
73
|
+
|
74
|
+
/** Executes when the value of this Setting changes */
|
75
|
+
onChange?: (value: T) => void;
|
76
|
+
|
77
|
+
filePicker?: (T extends string ? true | 'audio' | 'image' | 'video' | 'imagevideo' | 'folder' : never) | undefined;
|
78
|
+
}
|
79
|
+
|
80
|
+
interface SettingSubmenuConfig {
|
81
|
+
key: string;
|
82
|
+
|
83
|
+
namespace: string;
|
84
|
+
|
85
|
+
/** The human readable name */
|
86
|
+
name?: string | undefined;
|
87
|
+
|
88
|
+
/** The human readable label */
|
89
|
+
label?: string | undefined;
|
90
|
+
|
91
|
+
/** An additional human readable hint */
|
92
|
+
hint?: string | undefined;
|
93
|
+
|
94
|
+
/** The classname of an Icon to render */
|
95
|
+
icon?: string | undefined;
|
96
|
+
|
97
|
+
/** The FormApplication to render */
|
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>>;
|
102
|
+
|
103
|
+
/** If true, only a GM can edit this Setting */
|
104
|
+
restricted?: boolean | undefined;
|
105
|
+
}
|
106
|
+
|
23
107
|
/** A Client Keybinding Action Configuration */
|
24
|
-
|
108
|
+
interface KeybindingActionConfig {
|
25
109
|
/** The namespace within which the action was registered */
|
26
110
|
namespace?: string;
|
27
111
|
|
@@ -38,10 +122,10 @@ declare interface KeybindingActionConfig {
|
|
38
122
|
editable?: KeybindingActionBinding[];
|
39
123
|
|
40
124
|
/** A function to execute when a key down event occurs. If True is returned, the event is consumed and no further keybinds execute. */
|
41
|
-
onDown?: () => boolean | void;
|
125
|
+
onDown?: (ctx: KeyboardEventContext) => boolean | void;
|
42
126
|
|
43
127
|
/** A function to execute when a key up event occurs. If True is returned, the event is consumed and no further keybinds execute. */
|
44
|
-
onUp?: () => boolean | void;
|
128
|
+
onUp?: (ctx: KeyboardEventContext) => boolean | void;
|
45
129
|
|
46
130
|
/** If True, allows Repeat events to execute the Action's onDown. Defaults to false. */
|
47
131
|
repeat?: boolean;
|
@@ -60,7 +144,7 @@ declare interface KeybindingActionConfig {
|
|
60
144
|
}
|
61
145
|
|
62
146
|
/** A Client Keybinding Action Binding */
|
63
|
-
|
147
|
+
interface KeybindingActionBinding {
|
64
148
|
/** The KeyboardEvent#code value from https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values */
|
65
149
|
key: string;
|
66
150
|
|
@@ -68,22 +152,44 @@ declare interface KeybindingActionBinding {
|
|
68
152
|
modifiers?: string[];
|
69
153
|
}
|
70
154
|
|
71
|
-
|
155
|
+
/** An action that can occur when a key is pressed */
|
156
|
+
interface KeybindingAction {
|
157
|
+
/** The namespaced machine identifier of the Action */
|
72
158
|
action: string;
|
159
|
+
|
160
|
+
/** The Keyboard key */
|
73
161
|
key: string;
|
162
|
+
|
163
|
+
/** The human readable name */
|
74
164
|
name: string;
|
165
|
+
|
166
|
+
/** Required modifiers */
|
75
167
|
requiredModifiers: string[];
|
168
|
+
|
169
|
+
/** Optional (reserved) modifiers */
|
76
170
|
optionalModifiers: string[];
|
171
|
+
|
172
|
+
/** The handler that executes onDown */
|
77
173
|
onDown: Function;
|
174
|
+
|
175
|
+
/** The handler that executes onUp */
|
78
176
|
onUp: Function;
|
177
|
+
|
178
|
+
/** If True, allows Repeat events to execute this Action's onDown */
|
79
179
|
repeat: boolean;
|
180
|
+
|
181
|
+
/** If true, only a GM can execute this Action */
|
80
182
|
restricted: boolean;
|
183
|
+
|
184
|
+
/** The registration precedence */
|
81
185
|
precedence: number;
|
186
|
+
|
187
|
+
/** The registration order */
|
82
188
|
order: number;
|
83
189
|
}
|
84
190
|
|
85
191
|
/** Keyboard event context */
|
86
|
-
|
192
|
+
interface KeyboardEventContext {
|
87
193
|
/** The normalized string key, such as "A" */
|
88
194
|
key: string;
|
89
195
|
|
@@ -115,6 +221,15 @@ declare interface KeyboardEventContext {
|
|
115
221
|
action: string | undefined;
|
116
222
|
}
|
117
223
|
|
224
|
+
/** Connected Gamepad info */
|
225
|
+
interface ConnectedGamepad {
|
226
|
+
/** A map of axes values */
|
227
|
+
axes: Map<string, number>;
|
228
|
+
|
229
|
+
/** The Set of pressed Buttons */
|
230
|
+
activeButtons: Set<string>;
|
231
|
+
}
|
232
|
+
|
118
233
|
type RequestData = object | object[] | string | string[];
|
119
234
|
|
120
235
|
interface SocketRequest {
|
@@ -183,5 +298,5 @@ interface SocketResponse {
|
|
183
298
|
/**
|
184
299
|
* An Array of created data objects
|
185
300
|
*/
|
186
|
-
result?: object[];
|
301
|
+
result?: object[] | string[];
|
187
302
|
}
|
@@ -441,7 +441,6 @@ export declare function setProperty(object: object, key: string, value: any): bo
|
|
441
441
|
|
442
442
|
/**
|
443
443
|
* Express a timestamp as a relative string
|
444
|
-
* TODO - figure out a way to localize this
|
445
444
|
* @param timeStamp - A timestamp string or Date object to be formatted as a relative time
|
446
445
|
* @returns A string expression for the relative time
|
447
446
|
*/
|
@@ -0,0 +1,52 @@
|
|
1
|
+
/**
|
2
|
+
* A wrapper method around `fetch` that attaches an AbortController signal to the `fetch` call for clean timeouts
|
3
|
+
* @see https://www.npmjs.com/package/node-fetch#request-cancellation-with-abortsignal
|
4
|
+
* @param url - The URL to make the Request to
|
5
|
+
* @param data - The data of the Request
|
6
|
+
* (defalt: `{}`)
|
7
|
+
* @param timeoutOptions - (default: `{}`)
|
8
|
+
* @throws {@link HttpError}
|
9
|
+
*/
|
10
|
+
export function fetchWithTimeout(
|
11
|
+
url: string,
|
12
|
+
data?: RequestInit | undefined,
|
13
|
+
{ timeoutMs, onTimeout }?: TimeoutOptions | undefined
|
14
|
+
): Promise<Response>;
|
15
|
+
|
16
|
+
/**
|
17
|
+
* A small wrapper that automatically asks for JSON
|
18
|
+
* @param url - The URL to make the Request to
|
19
|
+
* @param data - The data of the Request
|
20
|
+
* (defalt: `{}`)
|
21
|
+
* @param timeoutOptions - (default: `{}`)
|
22
|
+
*/
|
23
|
+
export function fetchJsonWithTimeout(
|
24
|
+
url: string,
|
25
|
+
data?: RequestInit | undefined,
|
26
|
+
{ timeoutMs, onTimeout }?: TimeoutOptions | undefined
|
27
|
+
): Promise<unknown>;
|
28
|
+
|
29
|
+
/**
|
30
|
+
* Represents an HTTP Error when a non-OK response is returned by Fetch
|
31
|
+
*/
|
32
|
+
export class HttpError extends Error {
|
33
|
+
constructor(statusText: string, code: number, displayMessage?: string | undefined);
|
34
|
+
|
35
|
+
code: number;
|
36
|
+
|
37
|
+
displayMessage: string;
|
38
|
+
}
|
39
|
+
|
40
|
+
interface TimeoutOptions {
|
41
|
+
/**
|
42
|
+
* How long to wait for a Response before cleanly aborting
|
43
|
+
* @defaultValue `30000`
|
44
|
+
*/
|
45
|
+
timeoutMs?: number | undefined;
|
46
|
+
|
47
|
+
/**
|
48
|
+
* A method to invoke if and when the timeout is reached
|
49
|
+
* @defaultValue `() => {}`
|
50
|
+
*/
|
51
|
+
onTimeout?: (() => void) | undefined;
|
52
|
+
}
|
@@ -201,10 +201,10 @@ interface NumberConstructor {
|
|
201
201
|
|
202
202
|
/**
|
203
203
|
* Attempt to create a number from a user-provided string.
|
204
|
-
* @param
|
204
|
+
* @param n - The value to convert; typically a string, but may already be a number.
|
205
205
|
* @returns The number that the string represents, or NaN if no number could be determined.
|
206
206
|
*/
|
207
|
-
fromString(str: string): number;
|
207
|
+
fromString(str: string | number): number;
|
208
208
|
}
|
209
209
|
|
210
210
|
interface ArrayConstructor {
|
@@ -35,6 +35,7 @@ declare class Semaphore {
|
|
35
35
|
/**
|
36
36
|
* A queue of pending function signatures
|
37
37
|
* @defaultValue `[]`
|
38
|
+
* @internal
|
38
39
|
* @remarks The first element of an element of `_queue` is always a function and the rest of the elements are
|
39
40
|
* parameters to be passed to that function.
|
40
41
|
*/
|
@@ -43,6 +44,7 @@ declare class Semaphore {
|
|
43
44
|
/**
|
44
45
|
* The number of tasks which are currently underway
|
45
46
|
* @defaultValue `0`
|
47
|
+
* @internal
|
46
48
|
*/
|
47
49
|
protected _active: number;
|
48
50
|
|
@@ -60,8 +62,9 @@ declare class Semaphore {
|
|
60
62
|
* Add a new tasks to the managed queue
|
61
63
|
* @param fn - A callable function
|
62
64
|
* @param args - Function arguments
|
65
|
+
* @returns A promise that resolves once the added function is executed
|
63
66
|
*/
|
64
|
-
add<F extends (...args: any[]) => any>(fn: F, ...args: Parameters<F>):
|
67
|
+
add<F extends (...args: any[]) => any>(fn: F, ...args: Parameters<F>): Promise<Awaited<ReturnType<F>>>;
|
65
68
|
|
66
69
|
/**
|
67
70
|
* Abandon any tasks which have not yet concluded
|
@@ -72,9 +75,9 @@ declare class Semaphore {
|
|
72
75
|
* Attempt to perform a task from the queue.
|
73
76
|
* If all workers are busy, do nothing.
|
74
77
|
* If successful, try again.
|
75
|
-
* @
|
78
|
+
* @internal
|
76
79
|
*/
|
77
|
-
protected _try(): Promise<
|
80
|
+
protected _try(): Promise<false | void>;
|
78
81
|
}
|
79
82
|
|
80
83
|
export default Semaphore;
|
@@ -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
|
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():
|
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<
|
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<
|
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
|
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():
|
18
|
+
static get defaultOptions(): FormApplicationOptions;
|
7
19
|
|
8
20
|
/** @override */
|
9
|
-
getData(options: Partial<
|
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: {
|
@@ -41,7 +41,7 @@ declare global {
|
|
41
41
|
get title(): string;
|
42
42
|
|
43
43
|
/**
|
44
|
-
* A convenience reference to the Actor
|
44
|
+
* A convenience reference to the Actor document
|
45
45
|
*/
|
46
46
|
get actor(): this['object'];
|
47
47
|
|
@@ -72,11 +72,6 @@ declare global {
|
|
72
72
|
*/
|
73
73
|
protected _onConfigureToken(event: JQuery.ClickEvent): void;
|
74
74
|
|
75
|
-
/**
|
76
|
-
* Handle requests to configure the default sheet used by this Actor
|
77
|
-
*/
|
78
|
-
protected _onConfigureSheet(event: JQuery.ClickEvent): void;
|
79
|
-
|
80
75
|
/**
|
81
76
|
* Handle changing the actor profile image by opening a FilePicker
|
82
77
|
*/
|
@@ -156,6 +151,13 @@ declare global {
|
|
156
151
|
event: DragEvent,
|
157
152
|
itemData: foundry.data.ItemData['_source']
|
158
153
|
): undefined | Promise<InstanceType<ConfiguredDocumentClass<typeof Item>>[]>;
|
154
|
+
|
155
|
+
/**
|
156
|
+
* Is the drop data coming from the same actor?
|
157
|
+
* @param data - The drop data.
|
158
|
+
* @internal
|
159
|
+
*/
|
160
|
+
protected _isFromSameActor(data: ActorSheet.DropData.Item): Promise<boolean>;
|
159
161
|
}
|
160
162
|
|
161
163
|
namespace ActorSheet {
|
@@ -66,20 +66,20 @@ declare global {
|
|
66
66
|
interface Data {
|
67
67
|
core: {
|
68
68
|
version: string;
|
69
|
-
menus:
|
69
|
+
menus: SettingSubmenuConfig[];
|
70
70
|
settings: Setting[];
|
71
71
|
none: boolean;
|
72
72
|
};
|
73
73
|
system: {
|
74
74
|
title: Game['system']['data']['title'];
|
75
|
-
menus:
|
75
|
+
menus: SettingSubmenuConfig[];
|
76
76
|
settings: Setting[];
|
77
77
|
none: boolean;
|
78
78
|
};
|
79
|
-
modules: { title: string; menus:
|
79
|
+
modules: { title: string; menus: SettingSubmenuConfig[]; settings: Setting[] }[];
|
80
80
|
}
|
81
81
|
|
82
|
-
interface Setting extends Omit<
|
82
|
+
interface Setting extends Omit<SettingConfig, 'type'> {
|
83
83
|
id: string;
|
84
84
|
name: string;
|
85
85
|
hint: string;
|