@league-of-foundry-developers/foundry-vtt-types 0.8.9-9 → 9.238.0

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.
Files changed (178) hide show
  1. package/README.md +44 -27
  2. package/index.d.ts +2 -2
  3. package/package.json +34 -15
  4. package/src/foundry/common/abstract/document.mjs.d.ts +24 -10
  5. package/src/foundry/common/config.mjs/index.d.ts +1 -0
  6. package/src/foundry/common/config.mjs/releaseData.d.ts +98 -0
  7. package/src/foundry/common/constants.mjs.d.ts +402 -213
  8. package/src/foundry/common/data/data.mjs/activeEffectData.d.ts +36 -29
  9. package/src/foundry/common/data/data.mjs/actorData.d.ts +32 -21
  10. package/src/foundry/common/data/data.mjs/adventureData.d.ts +165 -0
  11. package/src/foundry/common/data/data.mjs/ambientLightData.d.ts +45 -124
  12. package/src/foundry/common/data/data.mjs/ambientSoundData.d.ts +49 -77
  13. package/src/foundry/common/data/data.mjs/animationData.d.ts +17 -9
  14. package/src/foundry/common/data/data.mjs/cardData.d.ts +265 -0
  15. package/src/foundry/common/data/data.mjs/cardFaceData.d.ts +66 -0
  16. package/src/foundry/common/data/data.mjs/cardsData.d.ts +238 -0
  17. package/src/foundry/common/data/data.mjs/chatMessageData.d.ts +51 -39
  18. package/src/foundry/common/data/data.mjs/chatSpeakerData.d.ts +18 -11
  19. package/src/foundry/common/data/data.mjs/combatData.d.ts +51 -25
  20. package/src/foundry/common/data/data.mjs/combatantData.d.ts +48 -30
  21. package/src/foundry/common/data/data.mjs/darknessActivation.d.ts +8 -7
  22. package/src/foundry/common/data/data.mjs/drawingData.d.ts +68 -67
  23. package/src/foundry/common/data/data.mjs/effectChangeData.d.ts +21 -25
  24. package/src/foundry/common/data/data.mjs/effectDurationData.d.ts +24 -23
  25. package/src/foundry/common/data/data.mjs/fogExplorationData.d.ts +23 -16
  26. package/src/foundry/common/data/data.mjs/folderData.d.ts +28 -25
  27. package/src/foundry/common/data/data.mjs/index.d.ts +5 -0
  28. package/src/foundry/common/data/data.mjs/itemData.d.ts +26 -18
  29. package/src/foundry/common/data/data.mjs/journalEntryData.d.ts +21 -20
  30. package/src/foundry/common/data/data.mjs/lightData.d.ts +228 -0
  31. package/src/foundry/common/data/data.mjs/macroData.d.ts +52 -35
  32. package/src/foundry/common/data/data.mjs/measuredTemplateData.d.ts +41 -38
  33. package/src/foundry/common/data/data.mjs/noteData.d.ts +47 -37
  34. package/src/foundry/common/data/data.mjs/playlistData.d.ts +55 -26
  35. package/src/foundry/common/data/data.mjs/playlistSoundData.d.ts +32 -16
  36. package/src/foundry/common/data/data.mjs/prototypeTokenData.d.ts +7 -11
  37. package/src/foundry/common/data/data.mjs/rollTableData.d.ts +30 -24
  38. package/src/foundry/common/data/data.mjs/sceneData.d.ts +132 -111
  39. package/src/foundry/common/data/data.mjs/settingData.d.ts +11 -8
  40. package/src/foundry/common/data/data.mjs/tableResultData.d.ts +30 -26
  41. package/src/foundry/common/data/data.mjs/tileData.d.ts +43 -36
  42. package/src/foundry/common/data/data.mjs/tileOcclusion.d.ts +10 -9
  43. package/src/foundry/common/data/data.mjs/tokenBarData.d.ts +6 -3
  44. package/src/foundry/common/data/data.mjs/tokenData.d.ts +105 -157
  45. package/src/foundry/common/data/data.mjs/userData.d.ts +111 -33
  46. package/src/foundry/common/data/data.mjs/videoData.d.ts +9 -8
  47. package/src/foundry/common/data/data.mjs/wallData.d.ts +67 -39
  48. package/src/foundry/common/data/fields.mjs.d.ts +180 -83
  49. package/src/foundry/common/documents.mjs/baseActiveEffect.d.ts +9 -3
  50. package/src/foundry/common/documents.mjs/baseActor.d.ts +17 -45
  51. package/src/foundry/common/documents.mjs/baseAdventure.d.ts +38 -0
  52. package/src/foundry/common/documents.mjs/baseAmbientLight.d.ts +3 -0
  53. package/src/foundry/common/documents.mjs/baseAmbientSound.d.ts +3 -1
  54. package/src/foundry/common/documents.mjs/baseCard.d.ts +62 -0
  55. package/src/foundry/common/documents.mjs/baseCards.d.ts +39 -0
  56. package/src/foundry/common/documents.mjs/baseChatMessage.d.ts +3 -0
  57. package/src/foundry/common/documents.mjs/baseCombat.d.ts +5 -2
  58. package/src/foundry/common/documents.mjs/baseCombatant.d.ts +10 -1
  59. package/src/foundry/common/documents.mjs/baseDrawing.d.ts +11 -1
  60. package/src/foundry/common/documents.mjs/baseFogExploration.d.ts +4 -3
  61. package/src/foundry/common/documents.mjs/baseFolder.d.ts +10 -1
  62. package/src/foundry/common/documents.mjs/baseItem.d.ts +11 -29
  63. package/src/foundry/common/documents.mjs/baseJournalEntry.d.ts +3 -0
  64. package/src/foundry/common/documents.mjs/baseMacro.d.ts +16 -14
  65. package/src/foundry/common/documents.mjs/baseMeasuredTemplate.d.ts +4 -1
  66. package/src/foundry/common/documents.mjs/baseNote.d.ts +2 -2
  67. package/src/foundry/common/documents.mjs/basePlaylist.d.ts +1 -0
  68. package/src/foundry/common/documents.mjs/basePlaylistSound.d.ts +2 -1
  69. package/src/foundry/common/documents.mjs/baseRollTable.d.ts +3 -0
  70. package/src/foundry/common/documents.mjs/baseScene.d.ts +1 -0
  71. package/src/foundry/common/documents.mjs/baseSetting.d.ts +1 -0
  72. package/src/foundry/common/documents.mjs/baseTableResult.d.ts +10 -3
  73. package/src/foundry/common/documents.mjs/baseTile.d.ts +1 -0
  74. package/src/foundry/common/documents.mjs/baseToken.d.ts +3 -0
  75. package/src/foundry/common/documents.mjs/baseUser.d.ts +7 -1
  76. package/src/foundry/common/documents.mjs/baseWall.d.ts +7 -10
  77. package/src/foundry/common/documents.mjs/index.d.ts +3 -0
  78. package/src/foundry/common/module.mjs.d.ts +3 -0
  79. package/src/foundry/common/packages.mjs/moduleData.d.ts +12 -9
  80. package/src/foundry/common/packages.mjs/packageAuthorData.d.ts +24 -24
  81. package/src/foundry/common/packages.mjs/packageCompendiumData.d.ts +27 -21
  82. package/src/foundry/common/packages.mjs/packageData.d.ts +108 -82
  83. package/src/foundry/common/packages.mjs/packageDependencyData.d.ts +18 -11
  84. package/src/foundry/common/packages.mjs/packageLanguageData.d.ts +16 -15
  85. package/src/foundry/common/packages.mjs/systemData.d.ts +21 -20
  86. package/src/foundry/common/packages.mjs/tagPackageAvailability.d.ts +3 -3
  87. package/src/foundry/common/packages.mjs/worldData.d.ts +29 -18
  88. package/src/foundry/common/types.mjs.d.ts +95 -0
  89. package/src/foundry/common/utils/helpers.mjs.d.ts +27 -2
  90. package/src/foundry/common/utils/primitives.mjs.d.ts +99 -16
  91. package/src/foundry/foundry.js/application.d.ts +2 -2
  92. package/src/foundry/foundry.js/applications/filePicker.d.ts +1 -1
  93. package/src/foundry/foundry.js/applications/formApplication.d.ts +1 -1
  94. package/src/foundry/foundry.js/applications/formApplications/documentSheet.d.ts +1 -1
  95. package/src/foundry/foundry.js/applications/formApplications/documentSheets/activeEffectConfig.d.ts +1 -1
  96. package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +1 -1
  97. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +104 -0
  98. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts +1 -1
  99. package/src/foundry/foundry.js/applications/formApplications/documentSheets/folderConfig.d.ts +1 -1
  100. package/src/foundry/foundry.js/applications/formApplications/documentSheets/index.d.ts +1 -0
  101. package/src/foundry/foundry.js/applications/formApplications/documentSheets/lightConfig.d.ts +5 -79
  102. package/src/foundry/foundry.js/applications/formApplications/documentSheets/measuredTemplateConfig.d.ts +1 -1
  103. package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +2 -2
  104. package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts +5 -5
  105. package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts +1 -1
  106. package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +5 -8
  107. package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +3 -3
  108. package/src/foundry/foundry.js/applications/formApplications/documentSheets/tileConfig.d.ts +1 -1
  109. package/src/foundry/foundry.js/applications/formApplications/drawingConfig.d.ts +1 -1
  110. package/src/foundry/foundry.js/applications/formApplications/gridConfig.d.ts +1 -1
  111. package/src/foundry/foundry.js/applications/formApplications/imagePopout.d.ts +1 -1
  112. package/src/foundry/foundry.js/applications/formApplications/index.d.ts +1 -0
  113. package/src/foundry/foundry.js/applications/formApplications/keybindingsConfig.d.ts +257 -0
  114. package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +8 -9
  115. package/src/foundry/foundry.js/applications/formApplications/wallConfig.d.ts +6 -6
  116. package/src/foundry/foundry.js/applications/sidebarTab.d.ts +1 -1
  117. package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +7 -6
  118. package/src/foundry/foundry.js/applications/sidebarTabs/compendiumDirectory.d.ts +2 -2
  119. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/cardsDirectory.d.ts +7 -0
  120. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/index.d.ts +1 -0
  121. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/playlistDirectory.d.ts +2 -2
  122. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +2 -2
  123. package/src/foundry/foundry.js/avSettings.d.ts +7 -7
  124. package/src/foundry/foundry.js/canvas.d.ts +148 -46
  125. package/src/foundry/foundry.js/canvasAnimation.d.ts +1 -1
  126. package/src/foundry/foundry.js/canvasDocumentMixin.d.ts +7 -0
  127. package/src/foundry/foundry.js/clientDocumentMixin.d.ts +45 -91
  128. package/src/foundry/foundry.js/clientDocuments/activeEffect.d.ts +3 -2
  129. package/src/foundry/foundry.js/clientDocuments/actor.d.ts +3 -7
  130. package/src/foundry/foundry.js/clientDocuments/canvasDocuments/ambientSoundDocument.d.ts +1 -6
  131. package/src/foundry/foundry.js/clientDocuments/card.d.ts +133 -0
  132. package/src/foundry/foundry.js/clientDocuments/cards.d.ts +384 -0
  133. package/src/foundry/foundry.js/clientDocuments/chatMessage.d.ts +11 -10
  134. package/src/foundry/foundry.js/clientDocuments/combat.d.ts +4 -8
  135. package/src/foundry/foundry.js/clientDocuments/combatant.d.ts +1 -1
  136. package/src/foundry/foundry.js/clientDocuments/folder.d.ts +4 -6
  137. package/src/foundry/foundry.js/clientDocuments/index.d.ts +2 -0
  138. package/src/foundry/foundry.js/clientDocuments/item.d.ts +3 -4
  139. package/src/foundry/foundry.js/clientDocuments/playlist.d.ts +4 -3
  140. package/src/foundry/foundry.js/clientDocuments/rollTable.d.ts +1 -1
  141. package/src/foundry/foundry.js/clientDocuments/scene.d.ts +30 -23
  142. package/src/foundry/foundry.js/clientKeybindings.d.ts +299 -0
  143. package/src/foundry/foundry.js/clientSettings.d.ts +11 -9
  144. package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +1 -1
  145. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/cardStacks.d.ts +9 -0
  146. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/index.d.ts +1 -0
  147. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/playlists.d.ts +3 -2
  148. package/src/foundry/foundry.js/config.d.ts +465 -887
  149. package/src/foundry/foundry.js/game.d.ts +86 -11
  150. package/src/foundry/foundry.js/gamepadManager.d.ts +41 -0
  151. package/src/foundry/foundry.js/handlebarsHelpers.d.ts +4 -4
  152. package/src/foundry/foundry.js/hooks.d.ts +57 -0
  153. package/src/foundry/foundry.js/keyboardManager.d.ts +165 -213
  154. package/src/foundry/foundry.js/mouseManager.d.ts +18 -0
  155. package/src/foundry/foundry.js/newUserExperience.d.ts +34 -0
  156. package/src/foundry/foundry.js/pixi/containers/cachedContainer.d.ts +8 -0
  157. package/src/foundry/foundry.js/pixi/containers/cachedContainers/index.d.ts +1 -0
  158. package/src/foundry/foundry.js/pixi/containers/cachedContainers/primaryCanvasGroup.d.ts +42 -0
  159. package/src/foundry/foundry.js/pixi/containers/canvasLayers/gridLayer.d.ts +2 -2
  160. package/src/foundry/foundry.js/pixi/containers/canvasLayers/index.d.ts +1 -1
  161. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/wallsLayer.d.ts +3 -3
  162. package/src/foundry/foundry.js/pixi/containers/canvasLayers/{effectsLayer.d.ts → weatherLayer.d.ts} +7 -7
  163. package/src/foundry/foundry.js/pixi/containers/effectsCanvasGroup.d.ts +29 -0
  164. package/src/foundry/foundry.js/pixi/containers/index.d.ts +3 -0
  165. package/src/foundry/foundry.js/pixi/containers/interfaceCanvasGroup.d.ts +27 -0
  166. package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +1 -1
  167. package/src/foundry/foundry.js/pointSource.d.ts +2 -2
  168. package/src/foundry/foundry.js/roll.d.ts +25 -36
  169. package/src/foundry/foundry.js/rollTerm.d.ts +7 -4
  170. package/src/foundry/foundry.js/rollTerms/diceTerm.d.ts +4 -22
  171. package/src/foundry/foundry.js/rollTerms/mathTerm.d.ts +3 -0
  172. package/src/foundry/foundry.js/rollTerms/parentheticalTerm.d.ts +3 -0
  173. package/src/foundry/foundry.js/rollTerms/poolTerm.d.ts +3 -5
  174. package/src/foundry/foundry.js/rollTerms/stringTerm.d.ts +4 -1
  175. package/src/foundry/foundry.js/searchFilter.d.ts +1 -1
  176. package/src/foundry/foundry.js/textEditor.d.ts +1 -1
  177. package/src/foundry/index.d.ts +4 -0
  178. package/src/types/utils.d.ts +11 -3
@@ -3,13 +3,13 @@ import * as fields from '../data/fields.mjs';
3
3
  import { PackageData, PackageDataConstructorData, PackageDataProperties, PackageDataSchema } from './packageData';
4
4
 
5
5
  interface WorldDataSchema extends Omit<PackageDataSchema, 'system'> {
6
- system: typeof fields.REQUIRED_STRING;
7
- background: typeof fields.STRING_FIELD;
8
- coreVersion: typeof fields.REQUIRED_STRING;
9
- nextSession: typeof fields.STRING_FIELD;
10
- resetKeys: typeof fields.BOOLEAN_FIELD;
11
- safeMode: typeof fields.BOOLEAN_FIELD;
12
- systemVersion: FieldReturnType<typeof fields.REQUIRED_STRING, { default: () => string }>;
6
+ system: fields.RequiredString;
7
+ background: fields.StringField;
8
+ coreVersion: fields.RequiredString;
9
+ nextSession: fields.StringField;
10
+ resetKeys: fields.BooleanField;
11
+ safeMode: fields.BooleanField;
12
+ systemVersion: FieldReturnType<fields.RequiredString, { default: () => string }>;
13
13
  }
14
14
 
15
15
  interface WorldDataProperties extends Omit<PackageDataProperties, 'system'> {
@@ -17,19 +17,24 @@ interface WorldDataProperties extends Omit<PackageDataProperties, 'system'> {
17
17
  system: string;
18
18
 
19
19
  /** A web URL or local file path which provides a background banner image */
20
- background?: string;
20
+ background: string | undefined;
21
21
 
22
22
  /** The version of the core software for which this world has been migrated */
23
23
  coreVersion: string;
24
24
 
25
25
  /** An ISO datetime string when the next game session is scheduled to occur */
26
- nextSession?: string;
26
+ nextSession: string | undefined;
27
27
 
28
+ /** @defaultValue `false` */
28
29
  resetKeys: boolean;
29
30
 
31
+ /** @defaultValue `false` */
30
32
  safeMode: boolean;
31
33
 
32
- /** The version of the game system for which this world has been migrated */
34
+ /**
35
+ * The version of the game system for which this world has been migrated
36
+ * @defaultValue `"0"`
37
+ */
33
38
  systemVersion: string;
34
39
  }
35
40
 
@@ -38,29 +43,35 @@ interface WorldDataConstructorData extends Omit<PackageDataConstructorData, 'sys
38
43
  system: string;
39
44
 
40
45
  /** A web URL or local file path which provides a background banner image */
41
- background?: string | null;
46
+ background?: string | null | undefined;
42
47
 
43
48
  /** The version of the core software for which this world has been migrated */
44
49
  coreVersion: string;
45
50
 
46
51
  /** An ISO datetime string when the next game session is scheduled to occur */
47
- nextSession?: string | null;
52
+ nextSession?: string | null | undefined;
48
53
 
49
- resetKeys?: boolean | null;
54
+ /** @defaultValue `false` */
55
+ resetKeys?: boolean | null | undefined;
50
56
 
51
- safeMode?: boolean | null;
57
+ /** @defaultValue `false` */
58
+ safeMode?: boolean | null | undefined;
52
59
 
53
- /** The version of the game system for which this world has been migrated */
54
- systemVersion?: string | null;
60
+ /**
61
+ * The version of the game system for which this world has been migrated
62
+ * @defaultValue `"0"`
63
+ */
64
+ systemVersion?: string | null | undefined;
55
65
  }
56
66
 
57
67
  /**
58
68
  * The data schema used to define World manifest files.
59
69
  * Extends the basic PackageData schema with some additional world-specific fields.
60
70
  */
61
- export declare class WorldData extends PackageData<WorldDataSchema, WorldDataProperties, WorldDataConstructorData> {
71
+ export class WorldData extends PackageData<WorldDataSchema, WorldDataProperties, WorldDataConstructorData> {
72
+ /** @override */
62
73
  static defineSchema(): WorldDataSchema;
63
74
  }
64
75
 
65
76
  // eslint-disable-next-line @typescript-eslint/no-empty-interface
66
- export declare interface WorldData extends WorldDataProperties {}
77
+ export interface WorldData extends WorldDataProperties {}
@@ -20,6 +20,101 @@ declare type Rectangle =
20
20
  height: number;
21
21
  };
22
22
 
23
+ /** A Client Keybinding Action Configuration */
24
+ declare interface KeybindingActionConfig {
25
+ /** The namespace within which the action was registered */
26
+ namespace?: string;
27
+
28
+ /** The human readable name */
29
+ name: string;
30
+
31
+ /** An additional human readable hint */
32
+ hint?: string;
33
+
34
+ /** The default bindings that can never be changed nor removed. */
35
+ uneditable?: KeybindingActionBinding[];
36
+
37
+ /** The default bindings that can be changed by the user. */
38
+ editable?: KeybindingActionBinding[];
39
+
40
+ /** 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;
42
+
43
+ /** 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;
45
+
46
+ /** If True, allows Repeat events to execute the Action's onDown. Defaults to false. */
47
+ repeat?: boolean;
48
+
49
+ /** If true, only a GM can edit and execute this Action */
50
+ restricted?: boolean;
51
+
52
+ /** Modifiers such as [ "CONTROL" ] that can be also pressed when executing this Action. Prevents using one of these modifiers as a Binding. */
53
+ reservedModifiers?: string[];
54
+
55
+ /** The preferred precedence of running this Keybinding Action */
56
+ precedence?: number; // TODO: KEYBINDING_PRECEDENCE?
57
+
58
+ /** The recorded registration order of the action */
59
+ order?: number;
60
+ }
61
+
62
+ /** A Client Keybinding Action Binding */
63
+ declare interface KeybindingActionBinding {
64
+ /** The KeyboardEvent#code value from https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values */
65
+ key: string;
66
+
67
+ /** An array of modifiers keys from KeyboardManager.MODIFIER_KEYS which are required for this binding to be activated */
68
+ modifiers?: string[];
69
+ }
70
+
71
+ declare interface KeybindingAction {
72
+ action: string;
73
+ key: string;
74
+ name: string;
75
+ requiredModifiers: string[];
76
+ optionalModifiers: string[];
77
+ onDown: Function;
78
+ onUp: Function;
79
+ repeat: boolean;
80
+ restricted: boolean;
81
+ precedence: number;
82
+ order: number;
83
+ }
84
+
85
+ /** Keyboard event context */
86
+ declare interface KeyboardEventContext {
87
+ /** The normalized string key, such as "A" */
88
+ key: string;
89
+
90
+ /** The originating keypress event */
91
+ event: KeyboardEvent;
92
+
93
+ /** Is the Shift modifier being pressed */
94
+ isShift: boolean;
95
+
96
+ /** Is the Control or Meta modifier being processed */
97
+ isControl: boolean;
98
+
99
+ /** Is the Alt modifier being pressed */
100
+ isAlt: boolean;
101
+
102
+ /** Are any of the modifiers being pressed */
103
+ hasModifier: boolean;
104
+
105
+ /** A list of string modifiers applied to this context, such as [ "CONTROL" ] */
106
+ modifiers: string[];
107
+
108
+ /** True if the Key is Up, else False if down */
109
+ up: boolean;
110
+
111
+ /** True if the given key is being held down such that it is automatically repeating. */
112
+ repeat: boolean;
113
+
114
+ /** The executing Keybinding Action. May be undefined until the action is known. */
115
+ action: string | undefined;
116
+ }
117
+
23
118
  type RequestData = object | object[] | string | string[];
24
119
 
25
120
  interface SocketRequest {
@@ -2,8 +2,13 @@
2
2
  * Benchmark the performance of a function, calling it a requested number of iterations.
3
3
  * @param func - The function to benchmark
4
4
  * @param iterations - The number of iterations to test
5
+ * @param args - Additional arguments passed to the benchmarked function
5
6
  */
6
- export declare function benchmark(func: () => unknown, iterations: number): void;
7
+ export declare function benchmark<F extends (...args: any[]) => unknown>(
8
+ func: F,
9
+ iterations: number,
10
+ ...args: Parameters<F>
11
+ ): Promise<void>;
7
12
 
8
13
  /**
9
14
  * Wrap a callback in a debounced timeout.
@@ -22,9 +27,18 @@ export declare function debounce<T extends (...args: any[]) => unknown>(
22
27
  * This method DOES support recursive data structures containing inner objects or arrays.
23
28
  * This method DOES NOT support advanced object types like Set, Map, or other specialized classes.
24
29
  * @param original - Some sort of data
30
+ * @param options - Options to configure the behaviour of deepClone
25
31
  * @returns The clone of that data
26
32
  */
27
- export declare function deepClone<T>(original: T): T;
33
+ export declare function deepClone<T>(original: T, options?: DeepCloneOptions): T;
34
+
35
+ interface DeepCloneOptions {
36
+ /**
37
+ * Throw an Error if deepClone is unable to clone something instead of returning the original
38
+ * @defaultValue `false`
39
+ */
40
+ strict?: boolean;
41
+ }
28
42
 
29
43
  /**
30
44
  * Deeply difference an object against some other, returning the update keys and values
@@ -101,6 +115,17 @@ type InnerDuplicated<T> = T extends { toJSON(): infer U }
101
115
  */
102
116
  export type Duplicated<T> = T extends NonStringifiable ? never : InnerDuplicated<T>;
103
117
 
118
+ /**
119
+ * Test whether some class is a subclass of a parent.
120
+ * @param cls - The class to test
121
+ * @param parent - Some other class which may be a parent
122
+ * @returns Is the class a subclass of the parent?
123
+ */
124
+ export declare function isSubclass(
125
+ cls: new (...args: any[]) => unknown,
126
+ parent: new (...args: any[]) => unknown
127
+ ): boolean;
128
+
104
129
  /**
105
130
  * Encode a url-like string by replacing any characters which need encoding
106
131
  * @param path - A fully-qualified URL or url component (like a relative path)
@@ -1,4 +1,4 @@
1
- declare interface Math {
1
+ interface Math {
2
2
  /**
3
3
  * Bound a number between some minimum and maximum value, inclusively
4
4
  * @param num - The current value
@@ -44,7 +44,7 @@ declare interface Math {
44
44
  toRadians(angle: number): number;
45
45
  }
46
46
 
47
- declare interface Set<T> {
47
+ interface Set<T> {
48
48
  /**
49
49
  * Test whether this set is equal to some other set.
50
50
  * Sets are equal if they share the same members, independent of order
@@ -53,6 +53,26 @@ declare interface Set<T> {
53
53
  */
54
54
  equals(other: Set<T>): boolean;
55
55
 
56
+ /**
57
+ * Return the first value from the set.
58
+ * @returns The first element in the set, or undefined
59
+ */
60
+ first(): T | undefined;
61
+
62
+ /**
63
+ * Return the intersection of two sets.
64
+ * @param other - Some other set to compare against
65
+ * @returns The intersection of both sets
66
+ */
67
+ intersection(other: Set<T>): Set<T>;
68
+
69
+ /**
70
+ * Test whether this set has an intersection with another set.
71
+ * @param other - Another set to compare against
72
+ * @returns Do the sets intersect?
73
+ */
74
+ intersects(other: Set<T>): boolean;
75
+
56
76
  /**
57
77
  * Test whether this set is a subset of some other set.
58
78
  * A set is a subset if all its members are also present in the other set.
@@ -62,9 +82,15 @@ declare interface Set<T> {
62
82
  isSubset(other: Set<T>): boolean;
63
83
  }
64
84
 
65
- declare interface String {
85
+ interface String {
86
+ /**
87
+ * Capitalize a string, transforming it's first character to a capital letter
88
+ */
66
89
  capitalize<S extends string>(this: S): Capitalize<S>;
67
90
 
91
+ /**
92
+ * Convert a string to Title Case where the first letter of each word is capitalized
93
+ */
68
94
  titleCase<S extends string>(this: S): Titlecase<S>;
69
95
 
70
96
  /**
@@ -74,20 +100,59 @@ declare interface String {
74
100
 
75
101
  /**
76
102
  * Transform any string into a url-viable slug string
77
- * @param replacement - The replacement character to separate terms
78
- * (default: `'-'`)
79
- * @param strict - Replace all non-alphanumeric characters, or allow them?
80
- * (default: `false`)
103
+ * @param options - Optional arguments which customize how the slugify operation is performed
81
104
  * @returns The cleaned slug string
82
105
  */
83
- slugify({ replacement, strict }?: { replacement?: string; strict?: boolean }): string;
106
+ slugify(options?: String.SlugifyOptions): string;
107
+ }
108
+
109
+ declare namespace String {
110
+ interface SlugifyOptions {
111
+ /**
112
+ * The replacement character to separate terms
113
+ * @defaultValue `'-'`
114
+ */
115
+ replacement?: string;
116
+
117
+ /**
118
+ * Replace all non-alphanumeric characters, or allow them?
119
+ * @defaultValue `false`
120
+ */
121
+ strict?: boolean;
122
+ }
84
123
  }
85
124
 
86
- declare interface Number {
125
+ interface Number {
126
+ /**
127
+ * Test for near-equivalence of two numbers within some permitted epsilon
128
+ * @param n - Some other number
129
+ * @param e - Some permitted epsilon, by default 1e-8
130
+ (default: `1e-8`)
131
+ * @returns Are the numbers almost equal?
132
+ */
133
+ almostEqual(n: number, e?: number): boolean;
134
+
135
+ /**
136
+ * Transform a number to an ordinal string representation. i.e.
137
+ * ```
138
+ * 1 => 1st
139
+ * 2 => 2nd
140
+ * 3 => 3rd
141
+ * ```
142
+ */
87
143
  ordinalString(): string;
88
144
 
145
+ /**
146
+ * Return a string front-padded by zeroes to reach a certain number of numeral characters
147
+ * @param digits - The number of characters desired
148
+ * @returns The zero-padded number
149
+ */
89
150
  paddedString(digits: number): string;
90
151
 
152
+ /**
153
+ * Return a string prefaced by the sign of the number (+) or (-)
154
+ * @returns The signed number as a string
155
+ */
91
156
  signedString(): string;
92
157
 
93
158
  /**
@@ -110,10 +175,15 @@ declare interface Number {
110
175
  */
111
176
  toNearest(interval?: number, method?: 'round' | 'ceil' | 'floor'): number;
112
177
 
178
+ /**
179
+ * A faster numeric between check which avoids type coercion to the Number object
180
+ * Since this avoids coercion, if non-numbers are passed in unpredictable results will occur. Use with caution.
181
+ * @param inclusive - (default: `true`)
182
+ */
113
183
  between(a: number, b: number, inclusive?: boolean): boolean;
114
184
  }
115
185
 
116
- declare interface NumberConstructor {
186
+ interface NumberConstructor {
117
187
  /**
118
188
  * A faster numeric between check which avoids type coercion to the Number object
119
189
  * Since this avoids coercion, if non-numbers are passed in unpredictable results will occur. Use with caution.
@@ -123,19 +193,27 @@ declare interface NumberConstructor {
123
193
 
124
194
  /**
125
195
  * Test whether a value is numeric
126
- * This is the highest performing algorithm currently available
127
- * https://jsperf.com/isnan-vs-typeof/5
196
+ * This is the highest performing algorithm currently available, per https://jsperf.com/isnan-vs-typeof/5
128
197
  * @param n - A value to test
129
198
  * @returns Is it a number?
130
199
  */
131
200
  isNumeric(n: unknown): n is number;
132
201
  }
133
202
 
134
- declare interface ArrayConstructor {
203
+ interface ArrayConstructor {
204
+ /**
205
+ * Create and initialize an array of length n with integers from 0 to n-1
206
+ * @param n - The desired array length
207
+ * @returns An array of integers from 0 to n
208
+ */
135
209
  fromRange(n: number): number[];
136
210
  }
137
211
 
138
- declare interface Array<T> {
212
+ interface Array<T> {
213
+ /**
214
+ * Flatten nested arrays by concatenating their contents
215
+ * @returns An array containing the concatenated inner values
216
+ */
139
217
  deepFlatten(): Array<Array.Flattened<T>>;
140
218
 
141
219
  /**
@@ -171,7 +249,7 @@ declare namespace Array {
171
249
  type Flattened<T> = T extends Array<infer U> ? Flattened<U> : T;
172
250
  }
173
251
 
174
- declare interface Date {
252
+ interface Date {
175
253
  /**
176
254
  * Test whether a Date instance is valid.
177
255
  * A valid date returns a number for its timestamp, and NaN otherwise.
@@ -192,6 +270,11 @@ declare interface Date {
192
270
  toTimeInputString(): string;
193
271
  }
194
272
 
195
- declare interface RegExpConstructor {
273
+ interface RegExpConstructor {
274
+ /**
275
+ * Escape a given input string, prefacing special characters with backslashes for use in a regular expression
276
+ * @param string - The un-escaped input string
277
+ * @returns The escaped string, suitable for use in regular expression
278
+ */
196
279
  escape(string: string): string;
197
280
  }
@@ -440,7 +440,7 @@ declare namespace Application {
440
440
 
441
441
  /**
442
442
  * The default CSS id to assign to the rendered HTML
443
- * @defaultValue `''`
443
+ * @defaultValue `""`
444
444
  */
445
445
  id: string;
446
446
 
@@ -452,7 +452,7 @@ declare namespace Application {
452
452
 
453
453
  /**
454
454
  * A default window title string (popOut only)
455
- * @defaultValue `''`
455
+ * @defaultValue `""`
456
456
  */
457
457
  title: string;
458
458
 
@@ -70,7 +70,7 @@ declare class FilePicker<
70
70
 
71
71
  /**
72
72
  * Record the last-browsed directory path so that re-opening a different FilePicker instance uses the same target
73
- * @defaultValue `''`
73
+ * @defaultValue `""`
74
74
  */
75
75
  static LAST_BROWSED_DIRECTORY: string;
76
76
 
@@ -171,7 +171,7 @@ declare abstract class FormApplication<
171
171
  * @param options - TinyMCE initialization options passed to TextEditor.create
172
172
  * (default: `{}`)
173
173
  * @param initialContent - Initial text content for the editor area.
174
- * (default: `''`)
174
+ * (default: `""`)
175
175
  */
176
176
  activateEditor(name: string, options?: TextEditor.Options, initialContent?: string): void;
177
177
 
@@ -120,7 +120,7 @@ declare global {
120
120
  /**
121
121
  * @defaultValue {@link ENTITY_PERMISSIONS.LIMITED}
122
122
  */
123
- viewPermission: foundry.CONST.EntityPermission;
123
+ viewPermission: foundry.CONST.DOCUMENT_PERMISSION_LEVELS;
124
124
  }
125
125
  }
126
126
  }
@@ -67,7 +67,7 @@ declare global {
67
67
  isActorEffect: boolean;
68
68
  isItemEffect: boolean;
69
69
  submitText: string;
70
- modes: Record<foundry.CONST.ActiveEffectMode, string>;
70
+ modes: Record<foundry.CONST.ACTIVE_EFFECT_MODES, string>;
71
71
  }
72
72
 
73
73
  type Options = DocumentSheet.Options;
@@ -194,7 +194,7 @@ declare global {
194
194
 
195
195
  interface Folder {
196
196
  type: 'Folder';
197
- documentName: foundry.CONST.FolderEntityTypes;
197
+ documentName: foundry.CONST.FOLDER_DOCUMENT_TYPES;
198
198
  id: string;
199
199
  }
200
200
  }
@@ -0,0 +1,104 @@
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
+ import type { DarknessActivationConstructorData } from '../../../../common/data/data.mjs/darknessActivation.js';
5
+ import type { LightDataConstructorData } from '../../../../common/data/data.mjs/lightData.js';
6
+
7
+ declare global {
8
+ /**
9
+ * The Application responsible for configuring a single AmbientLight document within a parent Scene.
10
+ * @typeParam Options - the type of the options object
11
+ * @typeParam Data - The data structure used to render the handlebars template.
12
+ */
13
+ class AmbientLightConfig<
14
+ Options extends DocumentSheet.Options = DocumentSheet.Options,
15
+ Data extends object = AmbientLightConfig.Data<Options>
16
+ > extends DocumentSheet<Options, Data, InstanceType<ConfiguredDocumentClassForName<'AmbientLight'>>> {
17
+ /**
18
+ * @override
19
+ * @defaultValue
20
+ * ```typescript
21
+ * foundry.utils.mergeObject(super.defaultOptions, {
22
+ * id: "ambient-light-config",
23
+ * classes: ["sheet", "ambient-light-config"],
24
+ * title: "LIGHT.ConfigTitle",
25
+ * template: "templates/scene/ambient-light-config.html",
26
+ * width: 480,
27
+ * height: "auto",
28
+ * tabs: [{navSelector: ".tabs", contentSelector: "form", initial: "basic"}]
29
+ * });
30
+ * ```
31
+ */
32
+ static get defaultOptions(): DocumentSheet.Options;
33
+
34
+ /**
35
+ * @param options - (unused)
36
+ * @override
37
+ */
38
+ getData(options?: Partial<Options>): Data | Promise<Data>;
39
+
40
+ /** @override */
41
+ close(options?: Application.CloseOptions): Promise<void>;
42
+
43
+ /** @override */
44
+ activateListeners(html: JQuery): void;
45
+
46
+ /**
47
+ * Preview the change caused by a change on the form by refreshing the display of the light source
48
+ */
49
+ protected _onChangeInput(event: JQuery.ChangeEvent): Promise<void>;
50
+
51
+ /** @override */
52
+ protected _onResetForm(event: PointerEvent): void;
53
+
54
+ /** @override */
55
+ protected _onChangeTab(event: MouseEvent | null, tabs: Tabs, active: string): void;
56
+
57
+ /**
58
+ * @param event - (unused)
59
+ * @override
60
+ */
61
+ protected _updateObject(
62
+ event: Event,
63
+ formData: AmbientLightConfig.FormData
64
+ ): Promise<InstanceType<ConfiguredDocumentClassForName<'AmbientLight'>> | undefined>;
65
+
66
+ /**
67
+ * Refresh the display of the AmbientLight object
68
+ * @internal
69
+ */
70
+ protected _refresh(): void;
71
+ }
72
+
73
+ namespace AmbientLightConfig {
74
+ interface Data<Options extends DocumentSheet.Options>
75
+ extends DocumentSheet.Data<InstanceType<ConfiguredDocumentClassForName<'AmbientLight'>>, Options> {
76
+ isAdvanced: boolean;
77
+ colorationTechniques: unknown; // FIXME: typeof AdaptiveLightingShader.COLORATION_TECHNIQUES
78
+ lightAnimations: Record<string, string> & {
79
+ '': 'None';
80
+ };
81
+ submitText: string;
82
+ }
83
+
84
+ interface FormData extends Pick<AmbientLightDataConstructorData, 'x' | 'y' | 'rotation' | 'walls' | 'vision'> {
85
+ 'config.dim': LightDataConstructorData['dim'];
86
+ 'config.bright': LightDataConstructorData['bright'];
87
+ 'config.angle': LightDataConstructorData['angle'];
88
+ 'config.color': LightDataConstructorData['color'];
89
+ 'config.alpha': LightDataConstructorData['alpha'];
90
+ 'config.darkness.min': DarknessActivationConstructorData['min'];
91
+ 'config.darkness.max': DarknessActivationConstructorData['max'];
92
+ 'config.animation.type': AnimationDataConstructorData['type'];
93
+ 'config.animation.speed': AnimationDataConstructorData['speed'];
94
+ 'config.animation.reverse': AnimationDataConstructorData['reverse'];
95
+ 'config.animation.intensity': AnimationDataConstructorData['intensity'];
96
+ 'config.coloration': LightDataConstructorData['coloration'];
97
+ 'config.luminosity': LightDataConstructorData['luminosity'];
98
+ 'config.gradual': LightDataConstructorData['gradual'];
99
+ 'config.saturation': LightDataConstructorData['saturation'];
100
+ 'config.contrast': LightDataConstructorData['contrast'];
101
+ 'config.shadows': LightDataConstructorData['shadows'];
102
+ }
103
+ }
104
+ }
@@ -49,7 +49,7 @@ declare global {
49
49
  submitText: string;
50
50
  }
51
51
 
52
- type FormData = Pick<foundry.data.AmbientSoundData, 'easing' | 'path' | 'type' | 'volume'> &
52
+ type FormData = Pick<foundry.data.AmbientSoundData, 'easing' | 'path' | 'volume'> &
53
53
  Pick<AmbientSoundDataConstructorData, 'radius' | 'x' | 'y'>;
54
54
 
55
55
  type Options = DocumentSheet.Options;
@@ -64,7 +64,7 @@ declare global {
64
64
  name: string;
65
65
  parent: string;
66
66
  sorting: SortingModes;
67
- type: foundry.CONST.FolderEntityTypes;
67
+ type: foundry.CONST.FOLDER_DOCUMENT_TYPES;
68
68
  }
69
69
  }
70
70
  }
@@ -1,5 +1,6 @@
1
1
  import './activeEffectConfig';
2
2
  import './actorSheet';
3
+ import './ambientLightConfig';
3
4
  import './ambientSoundConfig';
4
5
  import './combatantConfig';
5
6
  import './folderConfig';