@league-of-foundry-developers/foundry-vtt-types 0.8.9-4 → 0.8.9-8
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 +41 -13
- package/index-lenient.d.ts +10 -0
- package/package.json +10 -1
- package/src/foundry/common/abstract/backend.mjs.d.ts +14 -15
- package/src/foundry/common/abstract/document.mjs.d.ts +6 -2
- package/src/foundry/common/data/data.mjs/drawingData.d.ts +8 -3
- package/src/foundry/common/data/data.mjs/index.d.ts +2 -0
- package/src/foundry/common/data/data.mjs/playlistData.d.ts +171 -0
- package/src/foundry/common/data/data.mjs/playlistSoundData.d.ts +143 -0
- package/src/foundry/common/data/fields.mjs.d.ts +2 -2
- package/src/foundry/common/documents.mjs/basePlaylist.d.ts +11 -1
- package/src/foundry/common/documents.mjs/basePlaylistSound.d.ts +21 -2
- package/src/foundry/common/types.mjs.d.ts +5 -0
- package/src/foundry/foundry.js/application.d.ts +2 -5
- package/src/foundry/foundry.js/applications/cameraViews.d.ts +36 -31
- package/src/foundry/foundry.js/applications/compendium.d.ts +5 -2
- package/src/foundry/foundry.js/applications/filePicker.d.ts +114 -114
- package/src/foundry/foundry.js/applications/formApplication.d.ts +3 -11
- package/src/foundry/foundry.js/applications/formApplications/combatTrackerConfig.d.ts +20 -27
- package/src/foundry/foundry.js/applications/formApplications/defaultTokenConfig.d.ts +66 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheet.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/activeEffectConfig.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +5 -2
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts +57 -0
- package/src/foundry/foundry.js/applications/formApplications/{folderConfig.d.ts → documentSheets/folderConfig.d.ts} +2 -2
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/index.d.ts +7 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/lightConfig.d.ts +84 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/measuredTemplateConfig.d.ts +60 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +72 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts +54 -60
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts +41 -28
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistSoundConfig.d.ts +75 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +190 -148
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +133 -110
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/tileConfig.d.ts +66 -0
- package/src/foundry/foundry.js/applications/formApplications/drawingConfig.d.ts +93 -95
- package/src/foundry/foundry.js/applications/formApplications/entitySheetConfig.d.ts +163 -147
- package/src/foundry/foundry.js/applications/formApplications/index.d.ts +1 -7
- package/src/foundry/foundry.js/applications/formApplications/moduleManagement.d.ts +41 -23
- package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +95 -86
- package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +146 -158
- package/src/foundry/foundry.js/applications/formApplications/wallConfig.d.ts +60 -70
- package/src/foundry/foundry.js/applications/formApplications/worldConfig.d.ts +25 -17
- package/src/foundry/foundry.js/applications/headsUpDisplay.d.ts +11 -5
- package/src/foundry/foundry.js/applications/hotbar.d.ts +5 -4
- package/src/foundry/foundry.js/applications/sceneControls.d.ts +13 -3
- package/src/foundry/foundry.js/applications/sceneNavigation.d.ts +90 -71
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/actorDirectory.d.ts +13 -56
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/itemDirectory.d.ts +7 -30
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/journalDirectory.d.ts +14 -34
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/macroDirectory.d.ts +6 -52
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/playlistDirectory.d.ts +249 -139
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/sceneDirectory.d.ts +6 -23
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +3 -5
- package/src/foundry/foundry.js/cameraPopoutAppWrapper.d.ts +12 -7
- package/src/foundry/foundry.js/canvas.d.ts +2 -1
- package/src/foundry/foundry.js/clientDatabaseBackend.d.ts +210 -0
- package/src/foundry/foundry.js/clientDocumentMixin.d.ts +1 -1
- package/src/foundry/foundry.js/clientDocuments/canvasDocuments/index.d.ts +8 -0
- package/src/foundry/foundry.js/clientDocuments/canvasDocuments/tokenDocument.d.ts +1 -1
- package/src/foundry/foundry.js/clientDocuments/index.d.ts +19 -0
- package/src/foundry/foundry.js/clientDocuments/playlist.d.ts +195 -6
- package/src/foundry/foundry.js/clientDocuments/playlistSound.d.ts +113 -0
- package/src/foundry/foundry.js/clientDocuments/prototypeToken.d.ts +15 -0
- package/src/foundry/foundry.js/clientSettings.d.ts +14 -1
- package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +44 -8
- package/src/foundry/foundry.js/config.d.ts +85 -71
- package/src/foundry/foundry.js/dragDrop.d.ts +17 -14
- package/src/foundry/foundry.js/globalVariables.d.ts +7 -4
- package/src/foundry/foundry.js/mouseInteractionManager.d.ts +78 -34
- package/src/foundry/foundry.js/pixi/containers/canvasLayer.d.ts +2 -1
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayer.d.ts +10 -19
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/backgroundLayer.d.ts +6 -2
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/foregroundLayer.d.ts +2 -2
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/wallsLayer.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/containers/doorControl.d.ts +53 -35
- package/src/foundry/foundry.js/pixi/containers/placeableObject.d.ts +6 -2
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientLight.d.ts +38 -40
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientSound.d.ts +56 -56
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/note.d.ts +9 -50
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/tile.d.ts +166 -47
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/wall.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/containers/ruler.d.ts +11 -7
- package/src/foundry/foundry.js/pixi/graphics/gridHighlight.d.ts +4 -9
- package/src/foundry/foundry.js/pointSource.d.ts +173 -85
- package/src/foundry/foundry.js/textEditor.d.ts +39 -8
- package/src/foundry/index.d.ts +2 -25
- package/src/foundry/foundry.js/applications/formApplications/ambientSoundConfig.d.ts +0 -68
- package/src/foundry/foundry.js/applications/formApplications/lightConfig.d.ts +0 -98
- package/src/foundry/foundry.js/applications/formApplications/measuredTemplateConfig.d.ts +0 -61
- package/src/foundry/foundry.js/applications/formApplications/noteConfig.d.ts +0 -77
- package/src/foundry/foundry.js/applications/formApplications/playlistSoundConfig.d.ts +0 -70
- package/src/foundry/foundry.js/applications/formApplications/tileConfig.d.ts +0 -73
package/src/foundry/foundry.js/applications/formApplications/documentSheets/activeEffectConfig.d.ts
CHANGED
@@ -56,7 +56,7 @@ declare global {
|
|
56
56
|
* @override
|
57
57
|
* @param updateData - (default: `{}`)
|
58
58
|
*/
|
59
|
-
_getSubmitData(updateData?: FormApplication.OnSubmitOptions['updateData']):
|
59
|
+
_getSubmitData(updateData?: FormApplication.OnSubmitOptions['updateData']): Record<string, unknown>;
|
60
60
|
// TODO: Can we type this better?
|
61
61
|
}
|
62
62
|
|
@@ -67,7 +67,7 @@ declare global {
|
|
67
67
|
isActorEffect: boolean;
|
68
68
|
isItemEffect: boolean;
|
69
69
|
submitText: string;
|
70
|
-
modes: Record<
|
70
|
+
modes: Record<foundry.CONST.ActiveEffectMode, string>;
|
71
71
|
}
|
72
72
|
|
73
73
|
type Options = DocumentSheet.Options;
|
@@ -91,8 +91,11 @@ declare global {
|
|
91
91
|
/** @override */
|
92
92
|
protected _onDragStart(event: DragEvent): void;
|
93
93
|
|
94
|
-
/**
|
95
|
-
|
94
|
+
/**
|
95
|
+
* @override
|
96
|
+
* @internal
|
97
|
+
*/
|
98
|
+
protected _onDrop(event: DragEvent): void;
|
96
99
|
|
97
100
|
/**
|
98
101
|
* Handle the dropping of ActiveEffect data onto an Actor Sheet
|
package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
import type { ConfiguredDocumentClassForName } from '../../../../../types/helperTypes';
|
2
|
+
import type { AmbientSoundDataConstructorData } from '../../../../common/data/data.mjs/ambientSoundData';
|
3
|
+
|
4
|
+
declare global {
|
5
|
+
/**
|
6
|
+
* The Application responsible for configuring a single AmbientSound document within a parent Scene.
|
7
|
+
* @typeParam Options - the type of the options object
|
8
|
+
* @typeParam Data - The data structure used to render the handlebars template.
|
9
|
+
*/
|
10
|
+
class AmbientSoundConfig<
|
11
|
+
Options extends DocumentSheet.Options = AmbientSoundConfig.Options,
|
12
|
+
Data extends object = AmbientSoundConfig.Data<Options>
|
13
|
+
> extends DocumentSheet<Options, Data, InstanceType<ConfiguredDocumentClassForName<'AmbientSound'>>> {
|
14
|
+
/**
|
15
|
+
* @override
|
16
|
+
* @defaultValue
|
17
|
+
* ```typescript
|
18
|
+
* foundry.utils.mergeObject(super.defaultOptions, {
|
19
|
+
* title: "SOUND.ConfigTitle",
|
20
|
+
* template: "templates/scene/sound-config.html",
|
21
|
+
* width: 480
|
22
|
+
* });
|
23
|
+
* ```
|
24
|
+
*/
|
25
|
+
static get defaultOptions(): DocumentSheet.Options;
|
26
|
+
|
27
|
+
/** @override */
|
28
|
+
get title(): string;
|
29
|
+
|
30
|
+
/** @override */
|
31
|
+
getData(options?: Partial<Options>): Promise<Data> | Data;
|
32
|
+
|
33
|
+
/**
|
34
|
+
* @param event - (unused)
|
35
|
+
* @override
|
36
|
+
*/
|
37
|
+
protected _updateObject(
|
38
|
+
event: Event,
|
39
|
+
formData: AmbientSoundConfig.FormData
|
40
|
+
): Promise<InstanceType<ConfiguredDocumentClassForName<'AmbientSound'>>>;
|
41
|
+
|
42
|
+
/** @override */
|
43
|
+
close(options?: Application.CloseOptions): Promise<void>;
|
44
|
+
}
|
45
|
+
|
46
|
+
namespace AmbientSoundConfig {
|
47
|
+
interface Data<Options extends DocumentSheet.Options>
|
48
|
+
extends DocumentSheet.Data<InstanceType<ConfiguredDocumentClassForName<'AmbientSound'>>, Options> {
|
49
|
+
submitText: string;
|
50
|
+
}
|
51
|
+
|
52
|
+
type FormData = Pick<foundry.data.AmbientSoundData, 'easing' | 'path' | 'type' | 'volume'> &
|
53
|
+
Pick<AmbientSoundDataConstructorData, 'radius' | 'x' | 'y'>;
|
54
|
+
|
55
|
+
type Options = DocumentSheet.Options;
|
56
|
+
}
|
57
|
+
}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import type { ConfiguredDocumentClass } from '
|
2
|
-
import type { SortingModes } from '
|
1
|
+
import type { ConfiguredDocumentClass } from '../../../../../types/helperTypes';
|
2
|
+
import type { SortingModes } from '../../../../common/data/data.mjs/folderData';
|
3
3
|
|
4
4
|
declare global {
|
5
5
|
/**
|
@@ -1,11 +1,18 @@
|
|
1
1
|
import './activeEffectConfig';
|
2
2
|
import './actorSheet';
|
3
|
+
import './ambientSoundConfig';
|
3
4
|
import './combatantConfig';
|
5
|
+
import './folderConfig';
|
4
6
|
import './itemSheet';
|
5
7
|
import './journalSheet';
|
8
|
+
import './lightConfig';
|
6
9
|
import './macroConfig';
|
10
|
+
import './measuredTemplateConfig';
|
11
|
+
import './noteConfig';
|
7
12
|
import './permissionControl';
|
8
13
|
import './playlistConfig';
|
14
|
+
import './playlistSoundConfig';
|
9
15
|
import './rollTableConfig';
|
10
16
|
import './sceneConfig';
|
17
|
+
import './tileConfig';
|
11
18
|
import './userConfig';
|
@@ -0,0 +1,84 @@
|
|
1
|
+
import type { ConfiguredDocumentClassForName } from '../../../../../types/helperTypes';
|
2
|
+
import type { AmbientLightDataConstructorData } from '../../../../common/data/data.mjs/ambientLightData';
|
3
|
+
import type { AnimationDataConstructorData } from '../../../../common/data/data.mjs/animationData';
|
4
|
+
|
5
|
+
declare global {
|
6
|
+
/**
|
7
|
+
* The Application responsible for configuring a single AmbientLight document within a parent Scene.
|
8
|
+
* @typeParam Options - the type of the options object
|
9
|
+
* @typeParam Data - The data structure used to render the handlebars template.
|
10
|
+
*/
|
11
|
+
class LightConfig<
|
12
|
+
Options extends DocumentSheet.Options = DocumentSheet.Options,
|
13
|
+
Data extends object = LightConfig.Data<Options>
|
14
|
+
> extends DocumentSheet<Options, Data, InstanceType<ConfiguredDocumentClassForName<'AmbientLight'>>> {
|
15
|
+
/**
|
16
|
+
* @override
|
17
|
+
* @defaultValue
|
18
|
+
* ```typescript
|
19
|
+
* foundry.utils.mergeObject(super.defaultOptions, {
|
20
|
+
* title: "LIGHT.ConfigTitle",
|
21
|
+
* template: "templates/scene/light-config.html",
|
22
|
+
* width: 480
|
23
|
+
* });
|
24
|
+
* ```
|
25
|
+
*/
|
26
|
+
static get defaultOptions(): DocumentSheet.Options;
|
27
|
+
|
28
|
+
/**
|
29
|
+
* @param options - (unused)
|
30
|
+
* @override
|
31
|
+
*/
|
32
|
+
getData(options?: Partial<Options>): Data | Promise<Data>;
|
33
|
+
|
34
|
+
/** @override */
|
35
|
+
close(options?: Application.CloseOptions): Promise<void>;
|
36
|
+
|
37
|
+
/**
|
38
|
+
* Preview the change caused by a change on the form by refreshing the display of the light source
|
39
|
+
*/
|
40
|
+
protected _onChangeInput(event: JQuery.ChangeEvent): Promise<void>;
|
41
|
+
|
42
|
+
/** @override */
|
43
|
+
protected _getSubmitData(
|
44
|
+
updateData?: LightConfig.FormData
|
45
|
+
): ReturnType<DocumentSheet['_getSubmitData']> & { tintAlpha: number };
|
46
|
+
|
47
|
+
/**
|
48
|
+
* @param event - (unused)
|
49
|
+
* @override
|
50
|
+
*/
|
51
|
+
protected _updateObject(
|
52
|
+
event: Event,
|
53
|
+
formData: LightConfig.FormData
|
54
|
+
): Promise<InstanceType<ConfiguredDocumentClassForName<'AmbientLight'>> | undefined>;
|
55
|
+
|
56
|
+
/**
|
57
|
+
* Refresh the display of the AmbientLight object
|
58
|
+
* @internal
|
59
|
+
*/
|
60
|
+
protected _refresh(): void;
|
61
|
+
}
|
62
|
+
|
63
|
+
namespace LightConfig {
|
64
|
+
interface Data<Options extends DocumentSheet.Options>
|
65
|
+
extends DocumentSheet.Data<InstanceType<ConfiguredDocumentClassForName<'AmbientLight'>>, Options> {
|
66
|
+
submitText: string;
|
67
|
+
lightTypes: Record<foundry.CONST.SourceType, string>;
|
68
|
+
lightAnimations: Record<string, string> & {
|
69
|
+
'': 'None';
|
70
|
+
};
|
71
|
+
colorIntensity: number;
|
72
|
+
}
|
73
|
+
|
74
|
+
interface FormData
|
75
|
+
extends Pick<
|
76
|
+
AmbientLightDataConstructorData,
|
77
|
+
'angle' | 'bright' | 'darknessThreshold' | 'dim' | 'rotation' | 't' | 'tintAlpha' | 'tintColor' | 'x' | 'y'
|
78
|
+
> {
|
79
|
+
'lightAnimation.intensity': AnimationDataConstructorData['intensity'];
|
80
|
+
'lightAnimation.speed': AnimationDataConstructorData['speed'];
|
81
|
+
'lightAnimation.type': AnimationDataConstructorData['type'];
|
82
|
+
}
|
83
|
+
}
|
84
|
+
}
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import type { ConfiguredDocumentClassForName } from '../../../../../types/helperTypes';
|
2
|
+
|
3
|
+
declare global {
|
4
|
+
/**
|
5
|
+
* The Application responsible for configuring a single MeasuredTemplate document within a parent Scene.
|
6
|
+
* @see {@link MeasuredTemplate}
|
7
|
+
* @typeParam Options - the type of the options object
|
8
|
+
* @typeParam Data - The data structure used to render the handlebars template.
|
9
|
+
*/
|
10
|
+
class MeasuredTemplateConfig<
|
11
|
+
Options extends DocumentSheet.Options = DocumentSheet.Options,
|
12
|
+
Data extends object = MeasuredTemplateConfig.Data
|
13
|
+
> extends DocumentSheet<Options, Data, InstanceType<ConfiguredDocumentClassForName<'MeasuredTemplate'>>> {
|
14
|
+
/**
|
15
|
+
* @override
|
16
|
+
* @defaultValue
|
17
|
+
* ```typescript
|
18
|
+
* foundry.utils.mergeObject(super.defaultOptions, {
|
19
|
+
* id: "template-config",
|
20
|
+
* classes: ["sheet", "template-sheet"],
|
21
|
+
* title: "Measurement Template Configuration",
|
22
|
+
* template: "templates/scene/template-config.html",
|
23
|
+
* width: 400,
|
24
|
+
* })
|
25
|
+
* ```
|
26
|
+
*/
|
27
|
+
static get defaultOptions(): DocumentSheet.Options;
|
28
|
+
|
29
|
+
/** @override */
|
30
|
+
getData(): Data | Promise<Data>;
|
31
|
+
|
32
|
+
/** @override */
|
33
|
+
protected _updateObject(
|
34
|
+
event: Event,
|
35
|
+
formData: MeasuredTemplateConfig.FormData
|
36
|
+
): Promise<InstanceType<ConfiguredDocumentClassForName<'MeasuredTemplate'>> | undefined>;
|
37
|
+
}
|
38
|
+
|
39
|
+
namespace MeasuredTemplateConfig {
|
40
|
+
interface Data<Options extends DocumentSheet.Options = DocumentSheet.Options>
|
41
|
+
extends DocumentSheet.Data<InstanceType<ConfiguredDocumentClassForName<'MeasuredTemplate'>>, Options> {
|
42
|
+
templateTypes: typeof CONFIG.MeasuredTemplate.types;
|
43
|
+
gridUnits: string;
|
44
|
+
submitText: string;
|
45
|
+
}
|
46
|
+
|
47
|
+
type FormData = {
|
48
|
+
angle: number | null;
|
49
|
+
borderColor: string;
|
50
|
+
direction: number | null;
|
51
|
+
distance: number | null;
|
52
|
+
fillColor: string;
|
53
|
+
t: ValueOf<foundry.CONST.MeasuredTemplateTypes>;
|
54
|
+
texture: string;
|
55
|
+
width: number | null;
|
56
|
+
x: number | null;
|
57
|
+
y: number | null;
|
58
|
+
};
|
59
|
+
}
|
60
|
+
}
|
@@ -0,0 +1,72 @@
|
|
1
|
+
import type { ConfiguredDocumentClassForName } from '../../../../../types/helperTypes';
|
2
|
+
|
3
|
+
declare global {
|
4
|
+
/**
|
5
|
+
* The Application responsible for configuring a single Note document within a parent Scene.
|
6
|
+
* @typeParam Options - the type of the options object
|
7
|
+
* @typeParam Data - The data structure used to render the handlebars template.
|
8
|
+
*/
|
9
|
+
class NoteConfig<
|
10
|
+
Options extends DocumentSheet.Options = DocumentSheet.Options,
|
11
|
+
Data extends object = NoteConfig.Data<Options>
|
12
|
+
> extends DocumentSheet<Options, Data, InstanceType<ConfiguredDocumentClassForName<'Note'>>> {
|
13
|
+
/**
|
14
|
+
* @override
|
15
|
+
* @defaultValue
|
16
|
+
* ```typescript
|
17
|
+
* foundry.utils.mergeObject(super.defaultOptions, {
|
18
|
+
* title: game.i18n.localize("NOTE.ConfigTitle"),
|
19
|
+
* template: "templates/scene/note-config.html",
|
20
|
+
* width: 400,
|
21
|
+
* })
|
22
|
+
* ```
|
23
|
+
*/
|
24
|
+
static get defaultOptions(): DocumentSheet.Options;
|
25
|
+
|
26
|
+
/**
|
27
|
+
* @param options - (unused)
|
28
|
+
* @override
|
29
|
+
*/
|
30
|
+
getData(options?: Partial<Options>): Data | Promise<Data>;
|
31
|
+
|
32
|
+
/**
|
33
|
+
* @param event - (unused)
|
34
|
+
* @override
|
35
|
+
*/
|
36
|
+
protected _updateObject(
|
37
|
+
event: Event,
|
38
|
+
formData: NoteConfig.FormData
|
39
|
+
): Promise<ConfiguredDocumentClassForName<'Note'> | undefined>;
|
40
|
+
|
41
|
+
/**
|
42
|
+
* @override
|
43
|
+
*/
|
44
|
+
close(options?: Application.CloseOptions): Promise<void>;
|
45
|
+
}
|
46
|
+
|
47
|
+
namespace NoteConfig {
|
48
|
+
interface Data<Options extends DocumentSheet.Options>
|
49
|
+
extends DocumentSheet.Data<InstanceType<ConfiguredDocumentClassForName<'Note'>>, Options> {
|
50
|
+
entry: ConfiguredDocumentClassForName<'JournalEntry'> | {};
|
51
|
+
entries: Journal['contents'];
|
52
|
+
icons: CONFIG['JournalEntry']['noteIcons'];
|
53
|
+
fontFamilies: Record<string, string>;
|
54
|
+
textAnchors: Record<foundry.CONST.TextAnchorPoint, string>;
|
55
|
+
submitText: string;
|
56
|
+
}
|
57
|
+
|
58
|
+
interface FormData {
|
59
|
+
entryId: string;
|
60
|
+
fontFamily: string;
|
61
|
+
fontSize: number | null;
|
62
|
+
icon: string;
|
63
|
+
iconSize: number | null;
|
64
|
+
iconTint: string;
|
65
|
+
text: string;
|
66
|
+
textAnchor: foundry.CONST.TextAnchorPoint;
|
67
|
+
textColor: string;
|
68
|
+
x: number | null;
|
69
|
+
y: number | null;
|
70
|
+
}
|
71
|
+
}
|
72
|
+
}
|
package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts
CHANGED
@@ -1,72 +1,66 @@
|
|
1
|
-
|
2
|
-
* A generic application for configuring permissions for various Entity types
|
3
|
-
* @typeParam P - the type of the options object
|
4
|
-
* @typeParam E - the type of the entity
|
5
|
-
*/
|
6
|
-
declare class PermissionControl<
|
7
|
-
P extends DocumentSheet.Options = DocumentSheet.Options,
|
8
|
-
E extends foundry.abstract.Document<any, any> = foundry.abstract.Document<any, any>
|
9
|
-
> extends DocumentSheet<P, PermissionControl.Data<E>, E> {
|
10
|
-
/**
|
11
|
-
* @param entity - The Entity instance for which permissions are being configured.
|
12
|
-
* @param options - Application options.
|
13
|
-
*/
|
14
|
-
constructor(entity: E, options?: Partial<P>);
|
1
|
+
import type { ConfiguredDocumentClassForName } from '../../../../../types/helperTypes';
|
15
2
|
|
3
|
+
declare global {
|
16
4
|
/**
|
17
|
-
*
|
18
|
-
* @
|
19
|
-
*
|
20
|
-
*
|
21
|
-
* id: "permission",
|
22
|
-
* template: "templates/apps/permission.html",
|
23
|
-
* width: 400
|
24
|
-
* });
|
25
|
-
* ```
|
5
|
+
* A generic application for configuring permissions for various Entity types
|
6
|
+
* @typeParam Options - the type of the options object
|
7
|
+
* @typeParam Data - The data structure used to render the handlebars template.
|
8
|
+
* @typeParam ConcreteDocument - the type of the Document which should be managed by this form sheet
|
26
9
|
*/
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
10
|
+
class PermissionControl<
|
11
|
+
Options extends DocumentSheet.Options = DocumentSheet.Options,
|
12
|
+
Data extends object = DocumentSheet.Data,
|
13
|
+
ConcreteDocument extends foundry.abstract.Document<any, any> = Data extends DocumentSheet.Data<infer T>
|
14
|
+
? T
|
15
|
+
: foundry.abstract.Document<any, any>
|
16
|
+
> extends DocumentSheet<Options, PermissionControl.Data<ConcreteDocument>, ConcreteDocument> {
|
17
|
+
/**
|
18
|
+
* @override
|
19
|
+
* @defaultValue
|
20
|
+
* ```typescript
|
21
|
+
* mergeObject(super.defaultOptions, {
|
22
|
+
* id: "permission",
|
23
|
+
* template: "templates/apps/permission.html",
|
24
|
+
* width: 400
|
25
|
+
* });
|
26
|
+
* ```
|
27
|
+
*/
|
28
|
+
static get defaultOptions(): DocumentSheet.Options;
|
31
29
|
|
32
|
-
|
33
|
-
|
34
|
-
* @override
|
35
|
-
*/
|
36
|
-
getData(options?: Partial<P>): PermissionControl.Data<E>;
|
30
|
+
/** @override */
|
31
|
+
get title(): string;
|
37
32
|
|
38
|
-
|
39
|
-
|
40
|
-
|
33
|
+
/**
|
34
|
+
* @override
|
35
|
+
* @param options - (unused)
|
36
|
+
*/
|
37
|
+
getData(options?: Partial<Options>): PermissionControl.Data<ConcreteDocument>;
|
41
38
|
|
42
|
-
|
43
|
-
|
44
|
-
entity: E;
|
45
|
-
currentDefault: number | '-1';
|
46
|
-
instructions: string;
|
47
|
-
defaultLevels: E extends Folder ? Data.FolderDefaultLevels : Data.EntityDefaultLevels;
|
48
|
-
playerLevels: E extends Folder ? Data.FolderPlayerLevels : Data.EntityPlayerLevels;
|
49
|
-
isFolder: E extends Folder ? true : false;
|
50
|
-
users: { user: User; level: number | '-1' }[];
|
39
|
+
/** @override */
|
40
|
+
protected _updateObject(event: Event, formData: PermissionControl.FormData): Promise<unknown>;
|
51
41
|
}
|
52
42
|
|
53
|
-
namespace
|
54
|
-
|
43
|
+
namespace PermissionControl {
|
44
|
+
interface Data<ConcreteDocument extends foundry.abstract.Document<any, any>> extends DocumentSheet.Data {
|
45
|
+
entity: ConcreteDocument;
|
46
|
+
currentDefault: foundry.CONST.EntityPermission | '-1';
|
47
|
+
instructions: string;
|
48
|
+
defaultLevels: Record<foundry.CONST.EntityPermission, string> & { '-1'?: string };
|
49
|
+
playerLevels: Record<foundry.CONST.EntityPermission | '-1', string> & { '-2'?: string };
|
50
|
+
isFolder: boolean;
|
51
|
+
users: {
|
52
|
+
user: InstanceType<ConfiguredDocumentClassForName<'User'>>;
|
53
|
+
level: foundry.CONST.EntityPermission | '-1';
|
54
|
+
}[];
|
55
|
+
}
|
55
56
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
type FolderPlayerLevels = Record<foundry.CONST.EntityPermission, string> & { '-2': string; '-1': string };
|
61
|
-
}
|
62
|
-
|
63
|
-
interface FormData {
|
64
|
-
[userId: string]: FormData.InputPermissionLevel;
|
65
|
-
default: FormData.InputPermissionLevel;
|
66
|
-
}
|
57
|
+
interface FormData {
|
58
|
+
[userId: string]: FormData.InputPermissionLevel;
|
59
|
+
default: FormData.InputPermissionLevel;
|
60
|
+
}
|
67
61
|
|
68
|
-
|
69
|
-
|
70
|
-
|
62
|
+
namespace FormData {
|
63
|
+
type InputPermissionLevel = foundry.CONST.EntityPermission | -1 | -2;
|
64
|
+
}
|
71
65
|
}
|
72
66
|
}
|
package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts
CHANGED
@@ -1,36 +1,49 @@
|
|
1
|
-
|
2
|
-
// eslint-disable-next-line
|
3
|
-
// @ts-nocheck
|
1
|
+
import type { ConfiguredDocumentClass } from '../../../../../types/helperTypes';
|
4
2
|
|
5
|
-
|
6
|
-
* Playlist Configuration Sheet
|
7
|
-
*/
|
8
|
-
declare class PlaylistConfig extends DocumentSheet<DocumentSheet.Options, PlaylistConfig.Data, Playlist> {
|
3
|
+
declare global {
|
9
4
|
/**
|
10
|
-
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
* options.id = "playlist-config";
|
14
|
-
* options.template = "templates/playlist/edit-playlist.html";
|
15
|
-
* options.width = 360;
|
16
|
-
* ```
|
5
|
+
* The Application responsible for configuring a single Playlist document.
|
6
|
+
* @typeParam Options - the type of the options object
|
7
|
+
* @typeParam Data - The data structure used to render the handlebars template.
|
17
8
|
*/
|
18
|
-
|
9
|
+
class PlaylistConfig<
|
10
|
+
Options extends DocumentSheet.Options = DocumentSheet.Options,
|
11
|
+
Data extends object = PlaylistConfig.Data<Options>
|
12
|
+
> extends DocumentSheet<Options, Data, InstanceType<ConfiguredDocumentClass<typeof Playlist>>> {
|
13
|
+
/**
|
14
|
+
* @defaultValue
|
15
|
+
* ```typescript
|
16
|
+
* const options = super.defaultOptions;
|
17
|
+
* options.id = "playlist-config";
|
18
|
+
* options.template = "templates/playlist/edit-playlist.html";
|
19
|
+
* options.width = 360;
|
20
|
+
* ```
|
21
|
+
*/
|
22
|
+
static get defaultOptions(): DocumentSheet.Options;
|
19
23
|
|
20
|
-
|
21
|
-
|
22
|
-
*/
|
23
|
-
get title(): string;
|
24
|
+
/** @override */
|
25
|
+
get title(): string;
|
24
26
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
/**
|
28
|
+
* @override
|
29
|
+
* @param options - (unused)
|
30
|
+
*/
|
31
|
+
getData(options?: Partial<Options>): Data | Promise<Data>;
|
32
|
+
|
33
|
+
/** @override */
|
34
|
+
protected _getFilePickerOptions(event: PointerEvent): FilePicker.Options;
|
35
|
+
|
36
|
+
/**
|
37
|
+
* @override
|
38
|
+
* @remarks The return type could be given more concretely but it is not supposed to be used.
|
39
|
+
*/
|
40
|
+
protected _onSelectFile(selection: string, filePicker: FilePicker): unknown;
|
41
|
+
}
|
31
42
|
|
32
|
-
|
33
|
-
|
34
|
-
|
43
|
+
namespace PlaylistConfig {
|
44
|
+
interface Data<Options extends DocumentSheet.Options = DocumentSheet.Options>
|
45
|
+
extends DocumentSheet.Data<InstanceType<ConfiguredDocumentClass<typeof Playlist>>, Options> {
|
46
|
+
modes: Record<foundry.CONST.PlaylistMode, string>;
|
47
|
+
}
|
35
48
|
}
|
36
49
|
}
|
package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistSoundConfig.d.ts
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
import type { ConfiguredDocumentClass } from '../../../../../types/helperTypes';
|
2
|
+
|
3
|
+
declare global {
|
4
|
+
/**
|
5
|
+
* The Application responsible for configuring a single PlaylistSound document within a parent Playlist.
|
6
|
+
*
|
7
|
+
* @param sound - The PlaylistSound document being configured
|
8
|
+
* @param options - Additional application rendering options
|
9
|
+
* @typeParam Options - the type of the options object
|
10
|
+
* @typeParam Data - The data structure used to render the handlebars template.
|
11
|
+
*/
|
12
|
+
class PlaylistSoundConfig<
|
13
|
+
Options extends DocumentSheet.Options = DocumentSheet.Options,
|
14
|
+
Data extends object = PlaylistSoundConfig.Data<Options>
|
15
|
+
> extends DocumentSheet<Options, Data, InstanceType<ConfiguredDocumentClass<typeof PlaylistSound>>> {
|
16
|
+
/**
|
17
|
+
* @override
|
18
|
+
* @defaultValue
|
19
|
+
* ```typescript
|
20
|
+
* foundry.utils.mergeObject(super.defaultOptions, {
|
21
|
+
* id: "track-config",
|
22
|
+
* template: "templates/playlist/edit-track.html",
|
23
|
+
* width: 360
|
24
|
+
* });
|
25
|
+
* ```
|
26
|
+
*/
|
27
|
+
static get defaultOptions(): DocumentSheet.Options;
|
28
|
+
|
29
|
+
/** @override */
|
30
|
+
get title(): string;
|
31
|
+
|
32
|
+
/**
|
33
|
+
* @override
|
34
|
+
* @param options - (unused)
|
35
|
+
*/
|
36
|
+
getData(options?: Partial<Options>): Data | Promise<Data>;
|
37
|
+
|
38
|
+
/** @override */
|
39
|
+
activateListeners(html: JQuery): void;
|
40
|
+
|
41
|
+
/**
|
42
|
+
* Auto-populate the track name using the provided filename, if a name is not already set
|
43
|
+
* @internal
|
44
|
+
*/
|
45
|
+
protected _onSourceChange(event: JQuery.ChangeEvent): void;
|
46
|
+
|
47
|
+
/**
|
48
|
+
* @override
|
49
|
+
* @param event - (unused)
|
50
|
+
*/
|
51
|
+
protected _updateObject(
|
52
|
+
event: Event,
|
53
|
+
formData: PlaylistSoundConfig.FormData
|
54
|
+
): Promise<InstanceType<ConfiguredDocumentClass<typeof PlaylistSound>> | undefined>;
|
55
|
+
}
|
56
|
+
|
57
|
+
namespace PlaylistSoundConfig {
|
58
|
+
/**
|
59
|
+
* @typeParam Options - the type of the options object
|
60
|
+
*/
|
61
|
+
interface Data<Options extends DocumentSheet.Options = DocumentSheet.Options>
|
62
|
+
extends DocumentSheet.Data<InstanceType<ConfiguredDocumentClass<typeof PlaylistSound>>, Options> {
|
63
|
+
lvolume: number;
|
64
|
+
}
|
65
|
+
|
66
|
+
interface FormData {
|
67
|
+
description: string;
|
68
|
+
fade: number | null;
|
69
|
+
lvolume: number;
|
70
|
+
name: string;
|
71
|
+
path: string;
|
72
|
+
repeat: boolean;
|
73
|
+
}
|
74
|
+
}
|
75
|
+
}
|