@league-of-foundry-developers/foundry-vtt-types 0.8.9-7 → 9.238.1
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 +44 -27
- package/index-lenient.d.ts +10 -0
- package/index.d.ts +2 -2
- package/package.json +43 -15
- package/src/foundry/common/abstract/backend.mjs.d.ts +14 -15
- package/src/foundry/common/abstract/document.mjs.d.ts +30 -12
- package/src/foundry/common/config.mjs/index.d.ts +1 -0
- package/src/foundry/common/config.mjs/releaseData.d.ts +98 -0
- package/src/foundry/common/constants.mjs.d.ts +402 -213
- package/src/foundry/common/data/data.mjs/activeEffectData.d.ts +36 -29
- package/src/foundry/common/data/data.mjs/actorData.d.ts +32 -21
- package/src/foundry/common/data/data.mjs/adventureData.d.ts +165 -0
- package/src/foundry/common/data/data.mjs/ambientLightData.d.ts +45 -124
- package/src/foundry/common/data/data.mjs/ambientSoundData.d.ts +49 -77
- package/src/foundry/common/data/data.mjs/animationData.d.ts +17 -9
- package/src/foundry/common/data/data.mjs/cardData.d.ts +265 -0
- package/src/foundry/common/data/data.mjs/cardFaceData.d.ts +66 -0
- package/src/foundry/common/data/data.mjs/cardsData.d.ts +238 -0
- package/src/foundry/common/data/data.mjs/chatMessageData.d.ts +51 -39
- package/src/foundry/common/data/data.mjs/chatSpeakerData.d.ts +18 -11
- package/src/foundry/common/data/data.mjs/combatData.d.ts +51 -25
- package/src/foundry/common/data/data.mjs/combatantData.d.ts +48 -30
- package/src/foundry/common/data/data.mjs/darknessActivation.d.ts +8 -7
- package/src/foundry/common/data/data.mjs/drawingData.d.ts +68 -67
- package/src/foundry/common/data/data.mjs/effectChangeData.d.ts +21 -25
- package/src/foundry/common/data/data.mjs/effectDurationData.d.ts +24 -23
- package/src/foundry/common/data/data.mjs/fogExplorationData.d.ts +23 -16
- package/src/foundry/common/data/data.mjs/folderData.d.ts +28 -25
- package/src/foundry/common/data/data.mjs/index.d.ts +5 -0
- package/src/foundry/common/data/data.mjs/itemData.d.ts +26 -18
- package/src/foundry/common/data/data.mjs/journalEntryData.d.ts +21 -20
- package/src/foundry/common/data/data.mjs/lightData.d.ts +228 -0
- package/src/foundry/common/data/data.mjs/macroData.d.ts +52 -35
- package/src/foundry/common/data/data.mjs/measuredTemplateData.d.ts +41 -38
- package/src/foundry/common/data/data.mjs/noteData.d.ts +47 -37
- package/src/foundry/common/data/data.mjs/playlistData.d.ts +55 -26
- package/src/foundry/common/data/data.mjs/playlistSoundData.d.ts +32 -16
- package/src/foundry/common/data/data.mjs/prototypeTokenData.d.ts +7 -11
- package/src/foundry/common/data/data.mjs/rollTableData.d.ts +30 -24
- package/src/foundry/common/data/data.mjs/sceneData.d.ts +132 -111
- package/src/foundry/common/data/data.mjs/settingData.d.ts +11 -8
- package/src/foundry/common/data/data.mjs/tableResultData.d.ts +30 -26
- package/src/foundry/common/data/data.mjs/tileData.d.ts +43 -36
- package/src/foundry/common/data/data.mjs/tileOcclusion.d.ts +10 -9
- package/src/foundry/common/data/data.mjs/tokenBarData.d.ts +6 -3
- package/src/foundry/common/data/data.mjs/tokenData.d.ts +105 -157
- package/src/foundry/common/data/data.mjs/userData.d.ts +111 -33
- package/src/foundry/common/data/data.mjs/videoData.d.ts +9 -8
- package/src/foundry/common/data/data.mjs/wallData.d.ts +67 -39
- package/src/foundry/common/data/fields.mjs.d.ts +180 -83
- package/src/foundry/common/documents.mjs/baseActiveEffect.d.ts +9 -3
- package/src/foundry/common/documents.mjs/baseActor.d.ts +17 -45
- package/src/foundry/common/documents.mjs/baseAdventure.d.ts +38 -0
- package/src/foundry/common/documents.mjs/baseAmbientLight.d.ts +3 -0
- package/src/foundry/common/documents.mjs/baseAmbientSound.d.ts +3 -1
- package/src/foundry/common/documents.mjs/baseCard.d.ts +62 -0
- package/src/foundry/common/documents.mjs/baseCards.d.ts +39 -0
- package/src/foundry/common/documents.mjs/baseChatMessage.d.ts +3 -0
- package/src/foundry/common/documents.mjs/baseCombat.d.ts +5 -2
- package/src/foundry/common/documents.mjs/baseCombatant.d.ts +10 -1
- package/src/foundry/common/documents.mjs/baseDrawing.d.ts +11 -1
- package/src/foundry/common/documents.mjs/baseFogExploration.d.ts +4 -3
- package/src/foundry/common/documents.mjs/baseFolder.d.ts +10 -1
- package/src/foundry/common/documents.mjs/baseItem.d.ts +11 -29
- package/src/foundry/common/documents.mjs/baseJournalEntry.d.ts +3 -0
- package/src/foundry/common/documents.mjs/baseMacro.d.ts +16 -14
- package/src/foundry/common/documents.mjs/baseMeasuredTemplate.d.ts +4 -1
- package/src/foundry/common/documents.mjs/baseNote.d.ts +2 -2
- package/src/foundry/common/documents.mjs/basePlaylist.d.ts +1 -0
- package/src/foundry/common/documents.mjs/basePlaylistSound.d.ts +2 -1
- package/src/foundry/common/documents.mjs/baseRollTable.d.ts +3 -0
- package/src/foundry/common/documents.mjs/baseScene.d.ts +1 -0
- package/src/foundry/common/documents.mjs/baseSetting.d.ts +1 -0
- package/src/foundry/common/documents.mjs/baseTableResult.d.ts +10 -3
- package/src/foundry/common/documents.mjs/baseTile.d.ts +1 -0
- package/src/foundry/common/documents.mjs/baseToken.d.ts +3 -0
- package/src/foundry/common/documents.mjs/baseUser.d.ts +7 -1
- package/src/foundry/common/documents.mjs/baseWall.d.ts +7 -10
- package/src/foundry/common/documents.mjs/index.d.ts +3 -0
- package/src/foundry/common/module.mjs.d.ts +3 -0
- package/src/foundry/common/packages.mjs/moduleData.d.ts +12 -9
- package/src/foundry/common/packages.mjs/packageAuthorData.d.ts +24 -24
- package/src/foundry/common/packages.mjs/packageCompendiumData.d.ts +27 -21
- package/src/foundry/common/packages.mjs/packageData.d.ts +108 -82
- package/src/foundry/common/packages.mjs/packageDependencyData.d.ts +18 -11
- package/src/foundry/common/packages.mjs/packageLanguageData.d.ts +16 -15
- package/src/foundry/common/packages.mjs/systemData.d.ts +21 -20
- package/src/foundry/common/packages.mjs/tagPackageAvailability.d.ts +3 -3
- package/src/foundry/common/packages.mjs/worldData.d.ts +29 -18
- package/src/foundry/common/types.mjs.d.ts +100 -0
- package/src/foundry/common/utils/helpers.mjs.d.ts +27 -2
- package/src/foundry/common/utils/primitives.mjs.d.ts +99 -16
- package/src/foundry/foundry.js/application.d.ts +4 -7
- 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 +116 -116
- package/src/foundry/foundry.js/applications/formApplication.d.ts +2 -2
- 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 +6 -3
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +104 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/{folderConfig.d.ts → documentSheets/folderConfig.d.ts} +3 -3
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/index.d.ts +4 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/lightConfig.d.ts +5 -79
- 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 +5 -5
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +187 -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 +1 -1
- 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/gridConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/imagePopout.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/index.d.ts +2 -3
- package/src/foundry/foundry.js/applications/formApplications/keybindingsConfig.d.ts +257 -0
- 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 +142 -155
- 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/hotbar.d.ts +5 -4
- package/src/foundry/foundry.js/applications/sceneNavigation.d.ts +90 -71
- package/src/foundry/foundry.js/applications/sidebarTab.d.ts +1 -1
- package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +7 -6
- package/src/foundry/foundry.js/applications/sidebarTabs/compendiumDirectory.d.ts +2 -2
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/actorDirectory.d.ts +13 -56
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/cardsDirectory.d.ts +7 -0
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/index.d.ts +1 -0
- 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 +2 -2
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/sceneDirectory.d.ts +6 -23
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +4 -6
- package/src/foundry/foundry.js/avSettings.d.ts +7 -7
- package/src/foundry/foundry.js/cameraPopoutAppWrapper.d.ts +12 -7
- package/src/foundry/foundry.js/canvas.d.ts +150 -47
- package/src/foundry/foundry.js/canvasAnimation.d.ts +1 -1
- package/src/foundry/foundry.js/canvasDocumentMixin.d.ts +7 -0
- package/src/foundry/foundry.js/clientDatabaseBackend.d.ts +210 -0
- package/src/foundry/foundry.js/clientDocumentMixin.d.ts +45 -91
- package/src/foundry/foundry.js/clientDocuments/activeEffect.d.ts +3 -2
- package/src/foundry/foundry.js/clientDocuments/actor.d.ts +3 -7
- package/src/foundry/foundry.js/clientDocuments/canvasDocuments/ambientSoundDocument.d.ts +1 -6
- package/src/foundry/foundry.js/clientDocuments/canvasDocuments/tokenDocument.d.ts +1 -1
- package/src/foundry/foundry.js/clientDocuments/card.d.ts +133 -0
- package/src/foundry/foundry.js/clientDocuments/cards.d.ts +384 -0
- package/src/foundry/foundry.js/clientDocuments/chatMessage.d.ts +11 -10
- package/src/foundry/foundry.js/clientDocuments/combat.d.ts +4 -8
- package/src/foundry/foundry.js/clientDocuments/combatant.d.ts +1 -1
- package/src/foundry/foundry.js/clientDocuments/folder.d.ts +4 -6
- package/src/foundry/foundry.js/clientDocuments/index.d.ts +3 -0
- package/src/foundry/foundry.js/clientDocuments/item.d.ts +3 -4
- package/src/foundry/foundry.js/clientDocuments/playlist.d.ts +4 -3
- package/src/foundry/foundry.js/clientDocuments/prototypeToken.d.ts +15 -0
- package/src/foundry/foundry.js/clientDocuments/rollTable.d.ts +1 -1
- package/src/foundry/foundry.js/clientDocuments/scene.d.ts +30 -23
- package/src/foundry/foundry.js/clientKeybindings.d.ts +299 -0
- package/src/foundry/foundry.js/clientSettings.d.ts +21 -6
- package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +45 -12
- package/src/foundry/foundry.js/collections/documentCollections/worldCollections/cardStacks.d.ts +9 -0
- package/src/foundry/foundry.js/collections/documentCollections/worldCollections/index.d.ts +1 -0
- package/src/foundry/foundry.js/collections/documentCollections/worldCollections/playlists.d.ts +3 -2
- package/src/foundry/foundry.js/config.d.ts +467 -881
- package/src/foundry/foundry.js/dragDrop.d.ts +17 -14
- package/src/foundry/foundry.js/game.d.ts +171 -50
- package/src/foundry/foundry.js/gamepadManager.d.ts +41 -0
- package/src/foundry/foundry.js/globalVariables.d.ts +7 -4
- package/src/foundry/foundry.js/handlebarsHelpers.d.ts +4 -4
- package/src/foundry/foundry.js/hooks.d.ts +57 -0
- package/src/foundry/foundry.js/keyboardManager.d.ts +165 -213
- package/src/foundry/foundry.js/mouseInteractionManager.d.ts +78 -34
- package/src/foundry/foundry.js/mouseManager.d.ts +18 -0
- package/src/foundry/foundry.js/newUserExperience.d.ts +34 -0
- package/src/foundry/foundry.js/pixi/containers/cachedContainer.d.ts +8 -0
- package/src/foundry/foundry.js/pixi/containers/cachedContainers/index.d.ts +1 -0
- package/src/foundry/foundry.js/pixi/containers/cachedContainers/primaryCanvasGroup.d.ts +42 -0
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/gridLayer.d.ts +2 -2
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/index.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayer.d.ts +5 -17
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/wallsLayer.d.ts +4 -4
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/{effectsLayer.d.ts → weatherLayer.d.ts} +7 -7
- package/src/foundry/foundry.js/pixi/containers/effectsCanvasGroup.d.ts +29 -0
- package/src/foundry/foundry.js/pixi/containers/index.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/containers/interfaceCanvasGroup.d.ts +27 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObject.d.ts +4 -1
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/wall.d.ts +1 -1
- package/src/foundry/foundry.js/pointSource.d.ts +174 -86
- package/src/foundry/foundry.js/roll.d.ts +25 -36
- package/src/foundry/foundry.js/rollTerm.d.ts +7 -4
- package/src/foundry/foundry.js/rollTerms/diceTerm.d.ts +4 -22
- package/src/foundry/foundry.js/rollTerms/mathTerm.d.ts +3 -0
- package/src/foundry/foundry.js/rollTerms/parentheticalTerm.d.ts +3 -0
- package/src/foundry/foundry.js/rollTerms/poolTerm.d.ts +3 -5
- package/src/foundry/foundry.js/rollTerms/stringTerm.d.ts +4 -1
- package/src/foundry/foundry.js/searchFilter.d.ts +1 -1
- package/src/foundry/foundry.js/textEditor.d.ts +40 -9
- package/src/foundry/index.d.ts +5 -0
- package/src/types/utils.d.ts +11 -3
- package/src/foundry/foundry.js/applications/formApplications/measuredTemplateConfig.d.ts +0 -61
- package/src/foundry/foundry.js/applications/formApplications/noteConfig.d.ts +0 -77
@@ -8,144 +8,174 @@ declare class KeyboardManager {
|
|
8
8
|
/**
|
9
9
|
* The set of key codes which are currently depressed (down)
|
10
10
|
*/
|
11
|
-
|
11
|
+
downKeys: Set<string>;
|
12
12
|
|
13
13
|
/**
|
14
|
-
* The set of
|
14
|
+
* The set of movement keys which were recently pressed
|
15
15
|
*/
|
16
|
-
|
16
|
+
moveKeys: Set<string>;
|
17
17
|
|
18
18
|
/**
|
19
|
-
*
|
19
|
+
* Allowed modifier keys
|
20
20
|
*/
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
protected _moveTime: number | null;
|
27
|
-
|
28
|
-
/**
|
29
|
-
* @defaultValue `0`
|
30
|
-
*/
|
31
|
-
protected _tabState: 0 | 1;
|
21
|
+
static MODIFIER_KEYS: {
|
22
|
+
CONTROL: 'Control';
|
23
|
+
SHIFT: 'Shift';
|
24
|
+
ALT: 'Alt';
|
25
|
+
};
|
32
26
|
|
33
27
|
/**
|
34
|
-
*
|
28
|
+
* Track which KeyboardEvent#code presses associate with each modifier
|
35
29
|
*/
|
36
|
-
|
30
|
+
static MODIFIER_CODES: {
|
31
|
+
Alt: ['AltLeft', 'AltRight'];
|
32
|
+
Control: ['ControlLeft', 'ControlRight', 'MetaLeft', 'MetaRight'];
|
33
|
+
Shift: ['ShiftLeft', 'ShiftRight'];
|
34
|
+
};
|
37
35
|
|
38
36
|
/**
|
39
|
-
*
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
37
|
+
* Key codes which are "protected" and should not be used because they are reserved for browser-level actions.
|
38
|
+
*/
|
39
|
+
static PROTECTED_KEYS: ['F5', 'F11', 'F12', 'PrintScreen', 'ScrollLock', 'NumLock', 'CapsLock'];
|
40
|
+
|
41
|
+
/** The OS-specific string display for what their Command key is */
|
42
|
+
static CONTROL_KEY_STRING: '⌘' | 'Control';
|
43
|
+
|
44
|
+
/**
|
45
|
+
* An special mapping of how special KeyboardEvent#code values should map to displayed strings or symbols.
|
46
|
+
* Values in this configuration object override any other display formatting rules which may be applied.
|
47
|
+
*/
|
48
|
+
static KEYCODE_DISPLAY_MAPPING: {
|
49
|
+
ArrowLeft: '🡸';
|
50
|
+
ArrowRight: '🡺';
|
51
|
+
ArrowUp: '🡹';
|
52
|
+
ArrowDown: '🡻';
|
53
|
+
Backquote: '`';
|
54
|
+
Backslash: '\\';
|
55
|
+
BracketLeft: '[';
|
56
|
+
BracketRight: ']';
|
57
|
+
Comma: ',';
|
58
|
+
Equal: '=';
|
59
|
+
MetaLeft: '⌘' | '⊞';
|
60
|
+
Minus: '-';
|
61
|
+
NumpadAdd: 'Numpad+';
|
62
|
+
NumpadSubtract: 'Numpad-';
|
63
|
+
Period: '.';
|
64
|
+
Quote: "'";
|
65
|
+
Semicolon: ';';
|
66
|
+
Slash: '/';
|
67
|
+
};
|
44
68
|
|
45
69
|
/**
|
46
|
-
*
|
70
|
+
* Test whether an input currently has focus
|
47
71
|
*/
|
48
|
-
|
72
|
+
get hasFocus(): boolean;
|
49
73
|
|
50
74
|
/**
|
51
|
-
*
|
75
|
+
* Emulates a key being pressed, triggering the Keyboard event workflow.
|
76
|
+
* @param up - If True, emulates the `keyup` Event. Else, the `keydown` event
|
77
|
+
* @param code - The KeyboardEvent#code which is being pressed
|
78
|
+
* @param altKey - Emulate the ALT modifier as pressed
|
79
|
+
* (default: `false`)
|
80
|
+
* @param ctrlKey - Emulate the CONTROL modifier as pressed
|
81
|
+
* (default: `false`)
|
82
|
+
* @param shiftKey - Emulate the SHIFT modifier as pressed
|
83
|
+
* (default: `false`)
|
84
|
+
* @param repeat - Emulate this as a repeat event
|
85
|
+
* (default: `false`)
|
52
86
|
*/
|
53
|
-
static
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
ArrowRight: ['right'];
|
64
|
-
ArrowDown: ['down'];
|
65
|
-
ArrowLeft: ['left'];
|
66
|
-
Numpad1: ['down', 'left'];
|
67
|
-
Numpad2: ['down'];
|
68
|
-
Numpad3: ['down', 'right'];
|
69
|
-
Numpad4: ['left'];
|
70
|
-
Numpad6: ['right'];
|
71
|
-
Numpad7: ['up', 'left'];
|
72
|
-
Numpad8: ['up'];
|
73
|
-
Numpad9: ['up', 'right'];
|
74
|
-
};
|
87
|
+
static emulateKeypress(
|
88
|
+
up: boolean,
|
89
|
+
key: string,
|
90
|
+
{
|
91
|
+
altKey,
|
92
|
+
ctrlKey,
|
93
|
+
shiftKey,
|
94
|
+
repeat
|
95
|
+
}?: { altKey?: boolean; ctrlKey?: boolean; shiftKey?: boolean; repeat?: boolean }
|
96
|
+
): void;
|
75
97
|
|
76
98
|
/**
|
77
|
-
*
|
99
|
+
* Format a KeyboardEvent#code into a displayed string.
|
100
|
+
* @param code - The input code
|
101
|
+
* @returns The displayed string for this code
|
78
102
|
*/
|
79
|
-
static
|
80
|
-
PageUp: 'in';
|
81
|
-
PageDown: 'out';
|
82
|
-
NumpadAdd: 'in';
|
83
|
-
NumpadSubtract: 'out';
|
84
|
-
};
|
103
|
+
static getKeycodeDisplayString(code: string): string;
|
85
104
|
|
86
105
|
/**
|
87
|
-
*
|
106
|
+
* Get a standardized keyboard context for a given event.
|
107
|
+
* Every individual keypress is uniquely identified using the KeyboardEvent#code property.
|
108
|
+
* A list of possible key codes is documented here: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values
|
109
|
+
*
|
110
|
+
* @param event - The originating keypress event
|
111
|
+
* @param up - A flag for whether the key is down or up
|
112
|
+
* (default: `false`)
|
113
|
+
* @returns The standardized context of the event
|
88
114
|
*/
|
89
|
-
|
115
|
+
static getKeyboardEventContext(event: KeyboardEvent, up: boolean): KeyboardEventContext;
|
90
116
|
|
91
117
|
/**
|
92
|
-
*
|
93
|
-
* @param
|
118
|
+
* Report whether a modifier in KeyboardManager.MODIFIER_KEYS is currently actively depressed.
|
119
|
+
* @param modifier - A modifier in MODIFIER_KEYS
|
120
|
+
* @returns Is this modifier key currently down (active)?
|
94
121
|
*/
|
95
|
-
|
122
|
+
isModifierActive(modifier: string): boolean;
|
96
123
|
|
97
124
|
/**
|
98
|
-
*
|
99
|
-
* @param
|
125
|
+
* Converts a Keyboard Context event into a string representation, such as "C" or "Control+C"
|
126
|
+
* @param context - The standardized context of the event
|
127
|
+
* @param includeModifiers - If True, includes modifiers in the string representation
|
128
|
+
* (default: `true`)
|
129
|
+
* @internal
|
100
130
|
*/
|
101
|
-
|
131
|
+
protected static _getContextDisplayString(context: KeyboardEventContext, includeModifiers?: boolean): string;
|
102
132
|
|
103
133
|
/**
|
104
|
-
*
|
105
|
-
* @param
|
106
|
-
* @returns The
|
134
|
+
* Given a standardized pressed key, find all matching registered Keybind Actions.
|
135
|
+
* @param context - A standardized keyboard event context
|
136
|
+
* @returns The matched Keybind Actions. May be empty.
|
107
137
|
*/
|
108
|
-
|
138
|
+
protected static _getMatchingActions(context: KeyboardEventContext): KeybindingAction[];
|
109
139
|
|
110
140
|
/**
|
111
|
-
*
|
141
|
+
* Test whether a keypress context matches the registration for a keybinding action
|
142
|
+
* @param action - The keybinding action
|
143
|
+
* @param context - The keyboard event context
|
144
|
+
* @returns Does the context match the action requirements?
|
145
|
+
* @internal
|
112
146
|
*/
|
113
|
-
|
147
|
+
protected static _testContext(action: KeybindingAction, context: KeyboardEventContext): boolean;
|
114
148
|
|
115
149
|
/**
|
116
|
-
*
|
150
|
+
* Given a registered Keybinding Action, executes the action with a given event and context
|
151
|
+
*
|
152
|
+
* @param keybind - The registered Keybinding action to execute
|
153
|
+
* @param context - The gathered context of the event
|
154
|
+
* @returns Returns true if the keybind was consumed
|
155
|
+
* @internal
|
117
156
|
*/
|
118
|
-
|
157
|
+
protected static _executeKeybind(keybind: KeybindingAction, context: KeyboardEventContext): boolean;
|
119
158
|
|
120
159
|
/**
|
121
|
-
*
|
160
|
+
* Processes a keyboard event context, checking it against registered keybinding actions
|
161
|
+
* @param context - The keyboard event context
|
162
|
+
* @internal
|
122
163
|
*/
|
123
|
-
|
164
|
+
protected _processKeyboardContext(context: KeyboardEventContext): void;
|
124
165
|
|
125
166
|
/**
|
126
|
-
*
|
167
|
+
* Reset tracking for which keys are in the down and released states
|
168
|
+
* @internal
|
127
169
|
*/
|
128
|
-
|
170
|
+
protected _reset(): void;
|
129
171
|
|
130
172
|
/**
|
131
173
|
* Handle a key press into the down position
|
132
174
|
* @param event - The originating keyboard event
|
133
|
-
*/
|
134
|
-
protected _onKeyDown(event: KeyboardEvent): void;
|
135
|
-
|
136
|
-
/**
|
137
|
-
* Handle a key release into the up position
|
138
|
-
* @param event - The originating keyboard event
|
139
|
-
*/
|
140
|
-
protected _onKeyUp(event: KeyboardEvent): void;
|
141
|
-
|
142
|
-
/**
|
143
|
-
* Delegate tracked key codes by dispatching to their various handlers
|
144
|
-
* @param event - The keydown or keyup event
|
145
|
-
* @param key - The key being depressed
|
146
175
|
* @param up - A flag for whether the key is down or up
|
176
|
+
* @internal
|
147
177
|
*/
|
148
|
-
protected
|
178
|
+
protected _handleKeyboardEvent(event: KeyboardEvent, up: boolean): void;
|
149
179
|
|
150
180
|
/**
|
151
181
|
* Input events do not fire with isComposing = false at the end of a composition event in Chrome
|
@@ -153,143 +183,65 @@ declare class KeyboardManager {
|
|
153
183
|
*/
|
154
184
|
protected _onCompositionEnd(event: CompositionEvent): void;
|
155
185
|
|
156
|
-
/**
|
157
|
-
|
158
|
-
*/
|
159
|
-
protected _onWheel(event: WheelEvent): void;
|
186
|
+
/** @deprecated since v9, will be removed in v10 */
|
187
|
+
static get MOUSE_WHEEL_RATE_LIMIT(): number;
|
160
188
|
|
161
189
|
/**
|
162
|
-
*
|
163
|
-
*
|
164
|
-
* @param
|
165
|
-
* @param modifiers - The identified modifiers attached to this keypress
|
166
|
-
*/
|
167
|
-
protected _onTab(event: KeyboardEvent, up: boolean, modifiers: KeyboardManager.MetaModifiers): void;
|
168
|
-
|
169
|
-
/**
|
170
|
-
* Handle ESC keypress events
|
171
|
-
* @param event - The originating keyboard event
|
172
|
-
* @param up - Is the key being released?
|
173
|
-
* @param modifiers - The identified modifiers attached to this keypress
|
174
|
-
*/
|
175
|
-
protected _onEscape(
|
176
|
-
event: KeyboardEvent,
|
177
|
-
up: boolean,
|
178
|
-
modifiers: KeyboardManager.MetaModifiers
|
179
|
-
): void | Promise<void>;
|
180
|
-
|
181
|
-
/**
|
182
|
-
* Handle SPACE keypress events
|
183
|
-
* @param event - The originating keyboard event
|
184
|
-
* @param up - Is the key being released?
|
185
|
-
* @param modifiers - The identified modifiers attached to this keypress
|
186
|
-
*/
|
187
|
-
protected _onSpace(
|
188
|
-
event: KeyboardEvent,
|
189
|
-
up: boolean,
|
190
|
-
modifiers: KeyboardManager.MetaModifiers
|
191
|
-
): void | ReturnType<Set<string>['add']>;
|
192
|
-
|
193
|
-
/**
|
194
|
-
* Handle ALT keypress events
|
195
|
-
* @param event - The originating keyboard event
|
196
|
-
* @param up - Is the key being released?
|
197
|
-
* @param modifiers - The identified modifiers attached to this keypress
|
198
|
-
*/
|
199
|
-
protected _onAlt(event: KeyboardEvent, up: boolean, modifiers: KeyboardManager.MetaModifiers): void;
|
200
|
-
|
201
|
-
/**
|
202
|
-
* Handle movement keypress events
|
203
|
-
* @param event - The originating keyboard event
|
204
|
-
* @param up - Is the key being released?
|
205
|
-
* @param modifiers - The identified modifiers attached to this keypress
|
190
|
+
* @deprecated since V9, will be removed in V10
|
191
|
+
* Return whether the key code is currently in the DOWN state
|
192
|
+
* @param code - The key code to test
|
206
193
|
*/
|
207
|
-
|
194
|
+
isDown(code: string): boolean;
|
208
195
|
|
209
|
-
/**
|
210
|
-
|
211
|
-
*/
|
212
|
-
protected _handleMovement(event: KeyboardEvent, layer: PlaceablesLayer<any>): void;
|
196
|
+
/** @deprecated since v9, will be removed in v10 */
|
197
|
+
static isControl(event: KeyboardEvent | PIXI.InteractionEvent): boolean;
|
213
198
|
|
214
199
|
/**
|
215
|
-
*
|
200
|
+
* @deprecated since v9, will be removed in v10
|
201
|
+
* @see KeyboardManager.isControl
|
216
202
|
*/
|
217
|
-
|
218
|
-
|
219
|
-
/**
|
220
|
-
* Handle number key presses
|
221
|
-
* @param event - The original digit key press
|
222
|
-
* (unused)
|
223
|
-
* @param up - Is it a keyup?
|
224
|
-
* @param modifiers - What modifiers affect the keypress?
|
225
|
-
*/
|
226
|
-
protected _onDigit(event: KeyboardEvent, up: boolean, modifiers: KeyboardManager.MetaModifiers): void;
|
203
|
+
isCtrl(event: Event | PIXI.InteractionEvent): boolean;
|
227
204
|
|
228
|
-
/**
|
229
|
-
|
230
|
-
* @param event - The originating keyboard event
|
231
|
-
* (unused)
|
232
|
-
* @param up - Is the key being released?
|
233
|
-
* @param modifiers - The identified modifiers attached to this keypress
|
234
|
-
*/
|
235
|
-
protected _onKeyA(event: KeyboardEvent, up: boolean, modifiers: KeyboardManager.MetaModifiers): void;
|
205
|
+
/** @deprecated since v9, will be removed in v10 */
|
206
|
+
get _downKeys(): Set<string>;
|
236
207
|
|
237
|
-
/**
|
238
|
-
|
239
|
-
* @param event - The originating keyboard event
|
240
|
-
* @param up - Is the key being released?
|
241
|
-
* @param modifiers - The identified modifiers attached to this keypress
|
242
|
-
*/
|
243
|
-
protected _onKeyC(event: KeyboardEvent, up: boolean, modifiers: KeyboardManager.MetaModifiers): void;
|
208
|
+
/** @deprecated since v9, will be removed in v10 */
|
209
|
+
static DIGIT_KEYS: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'];
|
244
210
|
|
245
|
-
/**
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
211
|
+
/** @deprecated since v9, will be removed in v10 */
|
212
|
+
static MOVEMENT_KEYS: {
|
213
|
+
W: ['up'];
|
214
|
+
A: ['left'];
|
215
|
+
S: ['down'];
|
216
|
+
D: ['right'];
|
217
|
+
ARROWUP: ['up'];
|
218
|
+
ARROWRIGHT: ['right'];
|
219
|
+
ARROWDOWN: ['down'];
|
220
|
+
ARROWLEFT: ['left'];
|
221
|
+
NUMPAD1: ['down', 'left'];
|
222
|
+
NUMPAD2: ['down'];
|
223
|
+
NUMPAD3: ['down', 'right'];
|
224
|
+
NUMPAD4: ['left'];
|
225
|
+
NUMPAD6: ['right'];
|
226
|
+
NUMPAD7: ['up', 'left'];
|
227
|
+
NUMPAD8: ['up'];
|
228
|
+
NUMPAD9: ['up', 'right'];
|
229
|
+
};
|
252
230
|
|
253
|
-
/**
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
231
|
+
/** @deprecated since v9, will be removed in v10 */
|
232
|
+
static ZOOM_KEYS: {
|
233
|
+
PAGEUP: 'in';
|
234
|
+
PAGEDOWN: 'out';
|
235
|
+
NUMPADADD: 'in';
|
236
|
+
NUMPADSUBTRACT: 'out';
|
237
|
+
};
|
260
238
|
|
261
|
-
/**
|
262
|
-
|
263
|
-
* @param event - The originating keyboard event
|
264
|
-
* @param up - Is the key being released?
|
265
|
-
* @param modifiers - The identified modifiers attached to this keypress
|
266
|
-
*/
|
267
|
-
protected _onKeyZoom(
|
268
|
-
event: KeyboardEvent,
|
269
|
-
up: boolean,
|
270
|
-
modifiers: KeyboardManager.MetaModifiers
|
271
|
-
): void | ReturnType<Canvas['animatePan']>;
|
239
|
+
/** @deprecated since v9, will be removed in v10 */
|
240
|
+
static standardizeKey(key: string): string;
|
272
241
|
|
273
|
-
/**
|
274
|
-
|
275
|
-
* @param event - The originating keyboard event
|
276
|
-
* @param up - Is the key being released?
|
277
|
-
* @param modifiers - The identified modifiers attached to this keypress
|
278
|
-
*/
|
279
|
-
protected _onDelete(
|
280
|
-
event: KeyboardEvent,
|
281
|
-
up: boolean,
|
282
|
-
modifiers: KeyboardManager.MetaModifiers
|
283
|
-
): void | Promise<foundry.abstract.Document<any, any>[] | undefined>;
|
284
|
-
}
|
242
|
+
/** @deprecated since v9, will be removed in v10 */
|
243
|
+
get digitKeys(): typeof KeyboardManager.DIGIT_KEYS;
|
285
244
|
|
286
|
-
|
287
|
-
|
288
|
-
key: string;
|
289
|
-
isShift: boolean;
|
290
|
-
isCtrl: boolean;
|
291
|
-
isAlt: boolean;
|
292
|
-
hasFocus: boolean;
|
293
|
-
hasModifier: boolean;
|
294
|
-
}
|
245
|
+
/** @deprecated since v9, will be removed in v10 */
|
246
|
+
get zoomKeys(): KeybindingActionBinding[];
|
295
247
|
}
|