@mudlet/mudlet-web 0.5.0 → 1.0.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 +1 -1
- package/dist-lib/analytics.d.ts +27 -0
- package/dist-lib/assets/fonts/Vera.woff2 +0 -0
- package/dist-lib/assets/fonts/VeraBI.woff2 +0 -0
- package/dist-lib/assets/fonts/VeraBd.woff2 +0 -0
- package/dist-lib/assets/fonts/VeraIt.woff2 +0 -0
- package/dist-lib/assets/mapParser.worker-DrVZ3wg_.js +9 -0
- package/dist-lib/backupImport-wt8r7JXI.js +233 -0
- package/dist-lib/branding.d.ts +111 -13
- package/dist-lib/db/sqliteClient.d.ts +195 -7
- package/dist-lib/hooks/useAutoReconnect.d.ts +61 -0
- package/dist-lib/hooks/useDocumentFullscreen.d.ts +23 -0
- package/dist-lib/hooks/useKeyboardShortcuts.d.ts +37 -0
- package/dist-lib/hooks/useRecordLastPlayed.d.ts +10 -0
- package/dist-lib/import/applyMudletProfile.d.ts +35 -9
- package/dist-lib/import/backupImport.d.ts +118 -0
- package/dist-lib/import/collectProfileExport.d.ts +33 -2
- package/dist-lib/import/defaultPackages.d.ts +57 -14
- package/dist-lib/import/defaults/CF-loader/CF-loader.mpackage +0 -0
- package/dist-lib/import/defaults/MedBootstrap/MedBootstrap.mpackage +0 -0
- package/dist-lib/import/defaults/deleteOldProfiles/deleteOldProfiles.mpackage +0 -0
- package/dist-lib/import/defaults/echo/echo.mpackage +0 -0
- package/dist-lib/import/defaults/enable-accessibility/enable-accessibility.mpackage +0 -0
- package/dist-lib/import/defaults/generic_mapper/generic_mapper.mpackage +0 -0
- package/dist-lib/import/defaults/gui-drop/gui-drop.mpackage +0 -0
- package/dist-lib/import/defaults/icesus-loader/icesus-loader.mpackage +0 -0
- package/dist-lib/import/defaults/mg-loader/mg-loader.mpackage +0 -0
- package/dist-lib/import/defaults/mudlet-base-ui/mudlet-base-ui.mpackage +0 -0
- package/dist-lib/import/defaults/mudlet-mapper.xml +1215 -389
- package/dist-lib/import/mudletControlChars.d.ts +14 -0
- package/dist-lib/import/mudletHost.d.ts +73 -10
- package/dist-lib/import/mudletLink.d.ts +53 -2
- package/dist-lib/import/mudletProfileExport.d.ts +38 -5
- package/dist-lib/import/mudletProfileImport.d.ts +110 -12
- package/dist-lib/import/mudletVariables.d.ts +4 -3
- package/dist-lib/import/mudletWriteback.d.ts +15 -1
- package/dist-lib/import/mudletXmlImport.d.ts +46 -0
- package/dist-lib/import/packageFonts.d.ts +33 -0
- package/dist-lib/import/packageInstaller.d.ts +111 -7
- package/dist-lib/import/qtProfileData.d.ts +10 -0
- package/dist-lib/import/remotePackageInstall.d.ts +23 -7
- package/dist-lib/import/zipEntries.d.ts +45 -0
- package/dist-lib/index.d.ts +7 -3
- package/dist-lib/index.js +50508 -29836
- package/dist-lib/logging/SessionLogger.d.ts +75 -15
- package/dist-lib/map/MapSelectionOverlay.d.ts +2 -2
- package/dist-lib/map/MapStore.d.ts +387 -60
- package/dist-lib/map/MudletHighlightOverlay.d.ts +2 -2
- package/dist-lib/map/{MudixMapReader.d.ts → MudletMapReader.d.ts} +2 -2
- package/dist-lib/map/areaGraph.d.ts +120 -0
- package/dist-lib/map/environmentKit.d.ts +36 -0
- package/dist-lib/map/labelPixmap.d.ts +90 -0
- package/dist-lib/map/mapImageExport.d.ts +36 -2
- package/dist-lib/map/mapStyle.d.ts +11 -0
- package/dist-lib/map/mapVersion.d.ts +66 -0
- package/dist-lib/map/pathfinding.d.ts +2 -2
- package/dist-lib/mud/CharLoginController.d.ts +230 -0
- package/dist-lib/mud/ItemIdSequence.d.ts +1 -1
- package/dist-lib/mud/MudSession.d.ts +279 -22
- package/dist-lib/mud/PatternEngine.d.ts +153 -14
- package/dist-lib/mud/aliases/AliasEngine.d.ts +55 -9
- package/dist-lib/mud/autoLogin.d.ts +59 -0
- package/dist-lib/mud/commandSplit.d.ts +9 -0
- package/dist-lib/mud/connection/LineAssembler.d.ts +38 -11
- package/dist-lib/mud/connection/MudClient.d.ts +291 -53
- package/dist-lib/mud/connection/SubnegotiationRepair.d.ts +24 -0
- package/dist-lib/mud/connection/TelnetNegotiator.d.ts +208 -68
- package/dist-lib/mud/connection/telnetDebug.d.ts +8 -8
- package/dist-lib/mud/events.d.ts +102 -23
- package/dist-lib/mud/games/bundledGames.d.ts +12 -7
- package/dist-lib/mud/games/gameLinks.d.ts +40 -0
- package/dist-lib/mud/games/icons/3Kingdoms.png +0 -0
- package/dist-lib/mud/games/icons/3Scapes.png +0 -0
- package/dist-lib/mud/games/icons/achaea.png +0 -0
- package/dist-lib/mud/games/icons/aetolia.png +0 -0
- package/dist-lib/mud/games/icons/banner_astaria.png +0 -0
- package/dist-lib/mud/games/icons/banner_darkmists.png +0 -0
- package/dist-lib/mud/games/icons/banner_dreamland.png +0 -0
- package/dist-lib/mud/games/icons/banner_petria.jpg +0 -0
- package/dist-lib/mud/games/icons/banner_ropmud.png +0 -0
- package/dist-lib/mud/games/icons/blackmud.png +0 -0
- package/dist-lib/mud/games/icons/carrionfields.png +0 -0
- package/dist-lib/mud/games/icons/dragonfire_icon.png +0 -0
- package/dist-lib/mud/games/icons/fed2-logo.png +0 -0
- package/dist-lib/mud/games/icons/icesus_480x120.png +0 -0
- package/dist-lib/mud/games/icons/imperian.png +0 -0
- package/dist-lib/mud/games/icons/infinity_480x120.png +0 -0
- package/dist-lib/mud/games/icons/lusternia.png +0 -0
- package/dist-lib/mud/games/icons/morgengrauen_480x120.png +0 -0
- package/dist-lib/mud/games/icons/mudlet-tutorial.png +0 -0
- package/dist-lib/mud/games/icons/phoenixmud_480x120.png +0 -0
- package/dist-lib/mud/games/icons/starmourn.png +0 -0
- package/dist-lib/mud/games/icons/voidmud_icon.png +0 -0
- package/dist-lib/mud/games/icons/wotmudicon.png +0 -0
- package/dist-lib/mud/games/websiteLinks.d.ts +21 -0
- package/dist-lib/mud/keybindings/KeyEngine.d.ts +110 -4
- package/dist-lib/mud/keybindings/browserReservedKeys.d.ts +2 -2
- package/dist-lib/mud/keybindings/keyEventTarget.d.ts +61 -0
- package/dist-lib/mud/keybindings/qtKeys.d.ts +91 -12
- package/dist-lib/mud/protocol/atcp.d.ts +19 -0
- package/dist-lib/mud/protocol/byteString.d.ts +24 -0
- package/dist-lib/mud/protocol/charLoginFlow.d.ts +243 -16
- package/dist-lib/mud/protocol/charset.d.ts +111 -46
- package/dist-lib/mud/protocol/codePages.d.ts +10 -0
- package/dist-lib/mud/protocol/constants.d.ts +17 -10
- package/dist-lib/mud/protocol/echo.d.ts +23 -27
- package/dist-lib/mud/protocol/gmcp.d.ts +36 -6
- package/dist-lib/mud/protocol/index.d.ts +3 -2
- package/dist-lib/mud/protocol/luaLiteral.d.ts +12 -0
- package/dist-lib/mud/protocol/mccp.d.ts +83 -1
- package/dist-lib/mud/protocol/mnes.d.ts +41 -58
- package/dist-lib/mud/protocol/msdp.d.ts +11 -4
- package/dist-lib/mud/protocol/msp.d.ts +3 -2
- package/dist-lib/mud/protocol/mssp.d.ts +9 -4
- package/dist-lib/mud/protocol/multiByte.d.ts +51 -0
- package/dist-lib/mud/protocol/multiByteEncode.d.ts +42 -0
- package/dist-lib/mud/protocol/mxp.d.ts +193 -14
- package/dist-lib/mud/protocol/oauthClientFlow.d.ts +128 -0
- package/dist-lib/mud/protocol/qtCodePages.generated.d.ts +1 -0
- package/dist-lib/mud/protocol/tlsCodes.d.ts +40 -3
- package/dist-lib/mud/replay/ReplayPlayer.d.ts +16 -1
- package/dist-lib/mud/replay/replayFormat.d.ts +29 -2
- package/dist-lib/mud/text/Console.d.ts +255 -49
- package/dist-lib/mud/text/FormatState.d.ts +137 -14
- package/dist-lib/mud/text/ansiEscapes.d.ts +32 -16
- package/dist-lib/mud/text/colorParsers.d.ts +14 -2
- package/dist-lib/mud/text/colorSpaceId.d.ts +2 -0
- package/dist-lib/mud/text/colors.d.ts +17 -10
- package/dist-lib/mud/text/controlCharacterMode.d.ts +1 -1
- package/dist-lib/mud/text/hyperlinkVisibility.d.ts +1 -1
- package/dist-lib/mud/text/lineBreak.d.ts +5 -0
- package/dist-lib/mud/text/serverWrap.d.ts +2 -2
- package/dist-lib/mud/text/textAnalyzer.d.ts +79 -0
- package/dist-lib/mud/text/unicodeRuns.d.ts +11 -0
- package/dist-lib/mud/text/unicodeTables.generated.d.ts +3 -0
- package/dist-lib/mud/text/wcwidth.d.ts +27 -22
- package/dist-lib/mud/timers/TimerEngine.d.ts +163 -11
- package/dist-lib/mud/timers/workerClock.d.ts +67 -0
- package/dist-lib/mud/triggers/TriggerEngine.d.ts +449 -47
- package/dist-lib/mud/triggers/legacyColorPatterns.d.ts +58 -0
- package/dist-lib/mud/triggers/pcre/Pcre2.d.ts +83 -1
- package/dist-lib/oauth-callback.html +94 -0
- package/dist-lib/pcre2Wasm.d.ts +54 -0
- package/dist-lib/pcre2Wasm.js +241 -0
- package/dist-lib/scripting/EngineHost.d.ts +45 -21
- package/dist-lib/scripting/IScriptingRuntime.d.ts +103 -27
- package/dist-lib/scripting/MxpFrameManager.d.ts +10 -1
- package/dist-lib/scripting/ScriptingAPI.d.ts +1030 -213
- package/dist-lib/scripting/ScriptingEngine.d.ts +727 -106
- package/dist-lib/scripting/StopwatchManager.d.ts +97 -36
- package/dist-lib/scripting/http/HttpService.d.ts +9 -1
- package/dist-lib/scripting/http/userUrl.d.ts +41 -0
- package/dist-lib/scripting/lua/LuaRuntime.d.ts +352 -77
- package/dist-lib/scripting/lua/argContracts.d.ts +71 -0
- package/dist-lib/scripting/lua/bindings/automation.d.ts +1 -1
- package/dist-lib/scripting/lua/bindings/commands.d.ts +13 -0
- package/dist-lib/scripting/lua/bindings/context.d.ts +20 -2
- package/dist-lib/scripting/lua/bindings/diagnostics.d.ts +1 -1
- package/dist-lib/scripting/lua/bindings/map.d.ts +1 -1
- package/dist-lib/scripting/lua/bindings/media.d.ts +2 -2
- package/dist-lib/scripting/lua/bindings/output.d.ts +1 -1
- package/dist-lib/scripting/lua/bindings/session.d.ts +2 -2
- package/dist-lib/scripting/lua/bindings/textEdit.d.ts +1 -1
- package/dist-lib/scripting/lua/bindings/userWindows.d.ts +1 -1
- package/dist-lib/scripting/lua/byteArmor.d.ts +36 -0
- package/dist-lib/scripting/lua/imageSize.d.ts +7 -0
- package/dist-lib/scripting/lua/rex.d.ts +4 -2
- package/dist-lib/scripting/lua/sqlRowEncoder.d.ts +6 -1
- package/dist-lib/scripting/lua/utf8CaseMap.d.ts +1 -0
- package/dist-lib/scripting/lua/utf8Patterns.d.ts +21 -1
- package/dist-lib/scripting/lua/wellFormedStrings.d.ts +40 -0
- package/dist-lib/scripting/lua/yajl.d.ts +43 -5
- package/dist-lib/scripting/profilesPresence.d.ts +20 -2
- package/dist-lib/scripting/vfs/ProfileVFS.d.ts +164 -10
- package/dist-lib/scripting/vfs/fsErrors.d.ts +28 -0
- package/dist-lib/scripting/vfs/idbCommit.d.ts +20 -0
- package/dist-lib/storage/appStore.d.ts +24 -9
- package/dist-lib/storage/hooks.d.ts +5 -1
- package/dist-lib/storage/index.d.ts +2 -2
- package/dist-lib/storage/mapStorage.d.ts +2 -0
- package/dist-lib/storage/persistentStorage.d.ts +3 -1
- package/dist-lib/storage/profileStorage.d.ts +15 -0
- package/dist-lib/storage/profileVfsData.d.ts +3 -3
- package/dist-lib/storage/schema.d.ts +512 -40
- package/dist-lib/storage/storageMigration.d.ts +82 -0
- package/dist-lib/storage-g5V1b-c1.js +2039 -0
- package/dist-lib/styles.css +1 -1
- package/dist-lib/ui/AboutModal.d.ts +1 -1
- package/dist-lib/ui/BrandLoginFields.d.ts +1 -1
- package/dist-lib/ui/BrowserSignInModal.d.ts +23 -0
- package/dist-lib/ui/CmdLineMenuRegistry.d.ts +14 -5
- package/dist-lib/ui/CommandBar.d.ts +8 -8
- package/dist-lib/ui/ConnectionFormModal.d.ts +20 -1
- package/dist-lib/ui/ConnectionScreen.d.ts +9 -1
- package/dist-lib/ui/GameLinkPrompt.d.ts +28 -0
- package/dist-lib/ui/HelpModal.d.ts +5 -1
- package/dist-lib/ui/MapSymbolUsageModal.d.ts +32 -0
- package/dist-lib/ui/MouseEventRegistry.d.ts +31 -4
- package/dist-lib/ui/NotepadModal.d.ts +22 -0
- package/dist-lib/ui/ResizableModal.d.ts +16 -1
- package/dist-lib/ui/SettingsModal.d.ts +10 -1
- package/dist-lib/ui/TlsAlertBanner.d.ts +3 -1
- package/dist-lib/ui/Toolbar.d.ts +22 -1
- package/dist-lib/ui/VaultManageButton.d.ts +10 -5
- package/dist-lib/ui/VaultModal.d.ts +3 -0
- package/dist-lib/ui/buttons/ButtonsBar.d.ts +3 -1
- package/dist-lib/ui/buttons/inactiveButtons.d.ts +25 -0
- package/dist-lib/ui/cmdline/CommandLineManager.d.ts +19 -0
- package/dist-lib/ui/cmdline/plainText.d.ts +16 -0
- package/dist-lib/ui/cmdline/subCommandLine.d.ts +78 -0
- package/dist-lib/ui/cmdline/useCmdLineSelection.d.ts +26 -0
- package/dist-lib/ui/cmdline/useSubCommandLineKeys.d.ts +33 -0
- package/dist-lib/ui/codemirror/lineParagraphMarks.d.ts +19 -0
- package/dist-lib/ui/codemirror/luaHover.d.ts +7 -0
- package/dist-lib/ui/codemirror/options.d.ts +33 -0
- package/dist-lib/ui/codemirror/theme.d.ts +29 -5
- package/dist-lib/ui/commands/addonCommands.d.ts +134 -0
- package/dist-lib/ui/commands/appShortcuts.d.ts +86 -0
- package/dist-lib/ui/commands/hostCommands.d.ts +88 -0
- package/dist-lib/ui/commands/keyMatch.d.ts +20 -0
- package/dist-lib/ui/commands/keySequence.d.ts +57 -0
- package/dist-lib/ui/components/ContextMenu.d.ts +21 -1
- package/dist-lib/ui/components/FontPicker.d.ts +5 -1
- package/dist-lib/ui/components/useModalFocus.d.ts +13 -1
- package/dist-lib/ui/helpTopics.d.ts +15 -0
- package/dist-lib/ui/labels/LabelManager.d.ts +172 -9
- package/dist-lib/ui/labels/LabelOverlay.d.ts +19 -0
- package/dist-lib/ui/labels/backgroundImageSize.d.ts +19 -0
- package/dist-lib/ui/labels/labelModel.d.ts +64 -0
- package/dist-lib/ui/labels/qColor.d.ts +13 -0
- package/dist-lib/ui/labels/qtCss.d.ts +12 -4
- package/dist-lib/ui/landmarks.d.ts +9 -0
- package/dist-lib/ui/launcher/ActionMenu.d.ts +19 -0
- package/dist-lib/ui/launcher/GameDetails.d.ts +21 -0
- package/dist-lib/ui/launcher/GameSection.d.ts +18 -0
- package/dist-lib/ui/launcher/LauncherSearch.d.ts +23 -0
- package/dist-lib/ui/launcher/ProfileArt.d.ts +20 -0
- package/dist-lib/ui/launcher/ProfileSection.d.ts +43 -0
- package/dist-lib/ui/launcher/launcherModel.d.ts +72 -0
- package/dist-lib/ui/layout/overlayLayerOrder.d.ts +2 -2
- package/dist-lib/ui/menu/MenuBar.d.ts +31 -0
- package/dist-lib/ui/menu/SplitButton.d.ts +39 -0
- package/dist-lib/ui/menu/anchoredPopup.d.ts +74 -0
- package/dist-lib/ui/menu/appMenus.d.ts +65 -0
- package/dist-lib/ui/menu/menuModel.d.ts +88 -0
- package/dist-lib/ui/menu/toolbarModel.d.ts +56 -0
- package/dist-lib/ui/notepad.d.ts +76 -0
- package/dist-lib/ui/openSignInPage.d.ts +14 -0
- package/dist-lib/ui/output/OutputContextMenu.d.ts +14 -1
- package/dist-lib/ui/output/OutputRenderer.d.ts +5 -0
- package/dist-lib/ui/output/OutputSearchBar.d.ts +5 -1
- package/dist-lib/ui/output/StickyOutputPanel.d.ts +17 -3
- package/dist-lib/ui/output/TextAnalyzerModal.d.ts +25 -0
- package/dist-lib/ui/output/caretMode.d.ts +3 -2
- package/dist-lib/ui/output/clearSplit.d.ts +11 -0
- package/dist-lib/ui/output/outputCopy.d.ts +41 -2
- package/dist-lib/ui/output/outputRows.d.ts +43 -0
- package/dist-lib/ui/output/selectionGesture.d.ts +35 -0
- package/dist-lib/ui/output/wordSelection.d.ts +33 -0
- package/dist-lib/ui/search/matcher.d.ts +14 -4
- package/dist-lib/ui/settings/SettingsShell.d.ts +91 -0
- package/dist-lib/ui/settings/ShortcutEditor.d.ts +13 -0
- package/dist-lib/ui/sound/SoundManager.d.ts +210 -44
- package/dist-lib/ui/sound/closedCaption.d.ts +4 -1
- package/dist-lib/ui/sound/mediaDirection.d.ts +35 -0
- package/dist-lib/ui/tabCompletion.d.ts +53 -0
- package/dist-lib/ui/textedit/TextEditManager.d.ts +11 -2
- package/dist-lib/ui/useOpenProfiles.d.ts +1 -1
- package/dist-lib/ui/video/VideoManager.d.ts +7 -0
- package/dist-lib/ui/windows/WindowManager.d.ts +452 -37
- package/dist-lib/ui/windows/panels/ScriptEditorPanel.d.ts +14 -0
- package/dist-lib/ui/windows/panels/ScriptSearch.d.ts +6 -1
- package/dist-lib/ui/windows/panels/TextPanel.d.ts +4 -1
- package/dist-lib/ui/windows/panels/VariablesView.d.ts +37 -7
- package/dist-lib/ui/windows/panels/WindowCmdLine.d.ts +4 -2
- package/dist-lib/ui/windows/panels/aliasLoop.d.ts +24 -0
- package/dist-lib/ui/windows/panels/editorClipboard.d.ts +45 -0
- package/dist-lib/ui/windows/panels/editorUndo.d.ts +79 -0
- package/dist-lib/ui/windows/panels/mapAreaChange.d.ts +10 -0
- package/dist-lib/utils/appShellCache.d.ts +25 -0
- package/dist-lib/utils/fontFamilyName.d.ts +13 -0
- package/dist-lib/utils/fontLoader.d.ts +31 -0
- package/dist-lib/utils/formatBytes.d.ts +4 -0
- package/dist-lib/utils/mustBeOneOf.d.ts +9 -0
- package/dist-lib/utils/profileLock.d.ts +1 -1
- package/dist-lib/utils/systemTheme.d.ts +24 -0
- package/dist-lib/utils/timeZone.d.ts +10 -0
- package/dist-lib/vault/CredentialVault.d.ts +51 -5
- package/dist-lib/vault/deviceUnlock.d.ts +47 -0
- package/dist-lib/vault/vaultAccess.d.ts +24 -2
- package/dist-lib/vault/vaultHelpTopic.d.ts +9 -0
- package/dist-lib/vault/vaultRecord.d.ts +33 -1
- package/dist-lib/vfs-sw.js +220 -11
- package/dist-lib/vite.d.ts +1 -1
- package/dist-lib/vite.js +66 -43
- package/package.json +23 -15
- package/dist-lib/assets/mapParser.worker-t-3rd1zR.js +0 -9
- package/dist-lib/mud/connection/PingTracker.d.ts +0 -41
- package/dist-lib/ui/BundledGameGrid.d.ts +0 -21
- package/dist-lib/ui/ConnectionGrid.d.ts +0 -21
- package/dist-lib/ui/bufferWords.d.ts +0 -38
package/dist-lib/mud/events.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AnsiAwareBuffer } from './text/FormatState';
|
|
2
2
|
import type { MspCommand } from './protocol';
|
|
3
3
|
import type { ScriptLogSource } from './MudSession';
|
|
4
|
+
import type { CharLoginCapabilities, CharLoginResult, CharLoginToken, CharLoginUrl } from './protocol/charLoginFlow';
|
|
4
5
|
export type SessionStatus = 'disconnected' | 'connecting' | 'connected';
|
|
5
6
|
/** The peer certificate as reported by the proxy. Mirrors the four fields
|
|
6
7
|
* Mudlet shows (issuer / issued-to / expiry / serial) plus a little extra for
|
|
@@ -69,9 +70,35 @@ export type MudClientEvents = {
|
|
|
69
70
|
'open': [event: Event];
|
|
70
71
|
'close': [event: CloseEvent];
|
|
71
72
|
'error': [error: unknown];
|
|
73
|
+
/** The link to the game is up — Mudlet's `slot_socketConnected`. Through
|
|
74
|
+
* the proxy this waits for the proxy to reach the game (see
|
|
75
|
+
* `client.established`, which always follows it), so a dial that never
|
|
76
|
+
* gets there never raises it. */
|
|
72
77
|
'client.connect': void;
|
|
78
|
+
/** The connection, or the attempt at one, is over. Raised for an attempt
|
|
79
|
+
* that failed too — Mudlet raises sysDisconnectionEvent for both — which
|
|
80
|
+
* listeners tell apart by whether `client.connect` came first. */
|
|
73
81
|
'client.disconnect': void;
|
|
82
|
+
/** Raised straight after `client.disconnect`, once every listener on it has
|
|
83
|
+
* run. Mudlet reports a lost connection *after* sysDisconnectionEvent
|
|
84
|
+
* (ctelnet.cpp slot_socketDisconnected), so the notice hangs off this. */
|
|
85
|
+
'client.disconnected': void;
|
|
74
86
|
'client.error': [message: string];
|
|
87
|
+
/** One of cTelnet's `[ WARN ]` notices about the data stream (a broken
|
|
88
|
+
* MCCP stream, a read too big to inflate), in desktop's words: the first
|
|
89
|
+
* line carries the prefix, any after a `\n` are its continuation. */
|
|
90
|
+
'client.warning': [message: string];
|
|
91
|
+
/** The link to the *game* is up — the point in Mudlet's
|
|
92
|
+
* `slot_socketConnected` where `mConnectionTimer` starts (ctelnet.cpp:723).
|
|
93
|
+
* Emitted immediately after `client.connect`, for the same socket; kept as
|
|
94
|
+
* its own event for the things that time a session (the proxy accepts our
|
|
95
|
+
* WebSocket before it dials the game, so the WebSocket opening is never the
|
|
96
|
+
* moment to measure from). Fires at most once per socket,
|
|
97
|
+
* on whichever comes first of the proxy's `game.connected` control frame, a
|
|
98
|
+
* completed TLS handshake, or the first byte of game traffic — and
|
|
99
|
+
* immediately on open for a direct websocket, where there is no second leg.
|
|
100
|
+
* Anything measuring how long a session lasted wants this one. */
|
|
101
|
+
'client.established': void;
|
|
75
102
|
/** The WebSocket subprotocol the server selected from our advertised list
|
|
76
103
|
* (RFC 6455), or '' if none — only emitted when we advertised any. */
|
|
77
104
|
'client.subprotocol': [protocol: string];
|
|
@@ -94,6 +121,9 @@ export type MudClientEvents = {
|
|
|
94
121
|
port: number;
|
|
95
122
|
}];
|
|
96
123
|
'gmcp.negotiated': void;
|
|
124
|
+
/** Round trip (ms) from a game command to the next GA/EOR prompt marker —
|
|
125
|
+
* Mudlet's command-reply network latency measurement. */
|
|
126
|
+
'network.latency': [duration: number];
|
|
97
127
|
'msdp.negotiated': void;
|
|
98
128
|
'mssp.negotiated': void;
|
|
99
129
|
'msp.negotiated': void;
|
|
@@ -117,8 +147,10 @@ export type MudClientEvents = {
|
|
|
117
147
|
* on a server that skipped negotiation. Only telnet-negotiated MXP gets the
|
|
118
148
|
* `<SUPPORTS>`/`<VERSION>` handshake replies — an in-band-only server's
|
|
119
149
|
* inbound MXP channel isn't confirmed, so replying would spam it with
|
|
120
|
-
* invalid commands.
|
|
121
|
-
|
|
150
|
+
* invalid commands. `viaSubnegotiation` marks a bare `IAC SB MXP IAC SE`,
|
|
151
|
+
* which is reported every time it arrives — each one puts the processor
|
|
152
|
+
* back in locked mode — where the rest are reported once. */
|
|
153
|
+
'mxp.negotiated': [viaTelnet: boolean, viaSubnegotiation?: boolean];
|
|
122
154
|
/** Fired for every `!!SOUND` / `!!MUSIC` tag parsed from the in-band text
|
|
123
155
|
* stream (or an `IAC SB MSP ... IAC SE` subnegotiation body). The
|
|
124
156
|
* scripting engine wires this to the SoundManager. */
|
|
@@ -126,11 +158,18 @@ export type MudClientEvents = {
|
|
|
126
158
|
/** Fires when a CHARSET (RFC 2066) negotiation completes — either the
|
|
127
159
|
* server's REQUEST was ACCEPTED or our advertised REQUEST was ACCEPTED.
|
|
128
160
|
* Argument is the IANA charset name as agreed (the wire spelling, e.g.
|
|
129
|
-
* "UTF-8").
|
|
130
|
-
|
|
161
|
+
* "UTF-8"). `acceptedRequest` is true only when it was the server's
|
|
162
|
+
* REQUEST that this client ACCEPTED — the one case Mudlet saves. */
|
|
163
|
+
'charset.negotiated': [encoding: string, acceptedRequest?: boolean];
|
|
131
164
|
'socket.incoming': [data: string];
|
|
132
165
|
'socket.outgoing': [data: string];
|
|
133
|
-
|
|
166
|
+
/** `joinedTo`: the buffer lines this text was written onto instead of a
|
|
167
|
+
* line of its own — a command echoed onto the GA prompt line it was typed
|
|
168
|
+
* at (TConsole::printCommand's insertInLine branch). */
|
|
169
|
+
'message': [text?: string | AnsiAwareBuffer, type?: string, timestamp?: number, isPrompt?: boolean, joinedTo?: AnsiAwareBuffer[]];
|
|
170
|
+
/** A line from the game that a trigger deleted before it was shown, so
|
|
171
|
+
* no `message` carries it (TBuffer::commitLine's gagged branch). */
|
|
172
|
+
'line.gagged': [];
|
|
134
173
|
'flushLines': [groups: {
|
|
135
174
|
text: string;
|
|
136
175
|
type: string;
|
|
@@ -153,20 +192,38 @@ export type MudClientEvents = {
|
|
|
153
192
|
name: string;
|
|
154
193
|
value: string;
|
|
155
194
|
}];
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
*
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
195
|
+
/** A zMUD channel-102 subnegotiation (telnet option 102), which carries
|
|
196
|
+
* exactly two bytes: Aardwolf's variable number and its value. Reaches Lua
|
|
197
|
+
* as the `channel102` table plus a `channel102Message` event. */
|
|
198
|
+
'channel102': [payload: {
|
|
199
|
+
variable: number;
|
|
200
|
+
value: number;
|
|
201
|
+
}];
|
|
202
|
+
/** An inbound ATCP message (telnet option 200), split as desktop's
|
|
203
|
+
* `setATCPVariables` does: `name` keys the Lua `atcp` table and is the
|
|
204
|
+
* event raised, `value` the string both carry. */
|
|
205
|
+
'atcp': [payload: {
|
|
206
|
+
name: string;
|
|
207
|
+
value: string;
|
|
208
|
+
}];
|
|
209
|
+
/** Fires when the server requests GMCP login (Char.Login.Default), with
|
|
210
|
+
* everything the frame advertised: the negotiated version, the methods
|
|
211
|
+
* (e.g. `["password-credentials", "oauth"]`) and any client-driven OAuth
|
|
212
|
+
* capability. `CharLoginController` decides how to answer. */
|
|
213
|
+
'charLogin.request': [capabilities: CharLoginCapabilities];
|
|
214
|
+
/** Fires on `Char.Login.URL` — the game offering a page to sign in on.
|
|
215
|
+
* `null` when the address was missing, unparseable or not http(s), which
|
|
216
|
+
* is reported rather than rendered: it arrives unauthenticated. Can arrive
|
|
217
|
+
* at any point in a session, not just at login. */
|
|
218
|
+
'charLogin.url': [link: CharLoginUrl | null];
|
|
219
|
+
/** Fires on `Char.Login.Token` — a password-less reconnect token, issued at
|
|
220
|
+
* the game's discretion. A bearer secret: never log it. A malformed frame
|
|
221
|
+
* raises nothing. */
|
|
222
|
+
'charLogin.token': [token: CharLoginToken];
|
|
163
223
|
/** Fires when the server reports a GMCP login outcome (Char.Login.Result).
|
|
164
224
|
* `success` is true on a successful authentication; on failure `message`
|
|
165
225
|
* carries the server's human-readable reason (e.g. "Invalid credentials"). */
|
|
166
|
-
'charLogin.result': [result:
|
|
167
|
-
success: boolean;
|
|
168
|
-
message?: string;
|
|
169
|
-
}];
|
|
226
|
+
'charLogin.result': [result: CharLoginResult];
|
|
170
227
|
/** Fires when the command input should switch in/out of password masking.
|
|
171
228
|
* True only for a genuine password prompt (server enabled ECHO *after* it
|
|
172
229
|
* began sending output); a connect-time server-wide ECHO suppresses local
|
|
@@ -177,21 +234,34 @@ export type MudClientEvents = {
|
|
|
177
234
|
* point the client sends `IAC DONT ECHO` and refuses any further ECHO
|
|
178
235
|
* negotiation for the rest of the connection. */
|
|
179
236
|
'telnet.echo.anomaly': void;
|
|
180
|
-
/** Mudlet `sysTelnetEvent(type, option, message)` — fired for
|
|
181
|
-
* IAC
|
|
182
|
-
*
|
|
237
|
+
/** Mudlet `sysTelnetEvent(type, option, message)` — fired for every
|
|
238
|
+
* telnet IAC command except GA/EOR, handled options included. `type` is
|
|
239
|
+
* the command byte (251 WILL, 252 WONT, 253 DO, 254 DONT, 250 SB, …),
|
|
240
|
+
* `message` a byte-string: a subnegotiation's unescaped payload without
|
|
241
|
+
* its framing, any other command whole. */
|
|
183
242
|
'telnet.event': [type: number, option: number, message: string];
|
|
184
243
|
/** Mudlet `raiseProtocolEvent("sysProtocolRejected", name)` — a telnet
|
|
185
|
-
* option
|
|
244
|
+
* option Mudlet Web deliberately refuses. Mudlet Web, like Mudlet, operates in line
|
|
186
245
|
* mode only, so it rejects SUPPRESS_GO_AHEAD (option 3) and LINEMODE
|
|
187
246
|
* (option 34) rather than let the server switch it into character-at-a-
|
|
188
247
|
* time / server-driven line editing. The payload is the protocol name
|
|
189
248
|
* (`'SUPPRESS_GO_AHEAD'` or `'LINEMODE'`). */
|
|
190
249
|
'protocol.rejected': [protocol: string];
|
|
250
|
+
/** Mudlet `raiseProtocolEvent("sysProtocolEnabled", name)` — a telnet
|
|
251
|
+
* option the client has just agreed to (the server offered it with WILL,
|
|
252
|
+
* or asked for it with DO, and the profile allows it). The payload is
|
|
253
|
+
* Mudlet's name for the protocol, which is what reaches Lua as the second
|
|
254
|
+
* argument of `sysProtocolEnabled`: `GMCP`, `MSDP`, `MSSP`, `MSP`, `MXP`,
|
|
255
|
+
* `CHARSET`, `NEW_ENVIRON`, `NAWS` or `channel102`. */
|
|
256
|
+
'protocol.enabled': [protocol: string];
|
|
257
|
+
/** The other half of the pair: the option is off again, because the server
|
|
258
|
+
* withdrew it (WONT/DONT) or because the profile refuses an offer it had
|
|
259
|
+
* previously taken up. Same names as `protocol.enabled`. */
|
|
260
|
+
'protocol.disabled': [protocol: string];
|
|
191
261
|
/** Mudlet `sysCharacterModeDetected`. Fires once per connection when the
|
|
192
262
|
* server has both asked to suppress go-ahead (IAC WILL SGA) *and* kept
|
|
193
263
|
* server-side echo on across a submitted game command — the
|
|
194
|
-
* character-at-a-time signature that
|
|
264
|
+
* character-at-a-time signature that Mudlet Web, a line-based client, can't
|
|
195
265
|
* drive well. The three-second delay is what separates it from an ordinary
|
|
196
266
|
* password mask, which negotiates the same pair but releases echo as soon
|
|
197
267
|
* as the masked line is in. Lets scripts / the UI warn the user that input
|
|
@@ -204,16 +274,26 @@ export type MudClientEvents = {
|
|
|
204
274
|
* redials. Fires at most once per connection, and never once the profile's
|
|
205
275
|
* `promptForVersionInTTYPE` latch is set. */
|
|
206
276
|
'kavir.detected': void;
|
|
277
|
+
/** An IAC GA/EOR arrived. The next line flushed is the one it ended — an
|
|
278
|
+
* empty one for a bare marker, as in Mudlet. */
|
|
279
|
+
'prompt': void;
|
|
207
280
|
} & Record<string, any>;
|
|
208
281
|
export type MudEvents = MudClientEvents & {
|
|
209
282
|
'status': [status: SessionStatus];
|
|
283
|
+
/** The client ACCEPTed a server's CHARSET REQUEST and that changed the
|
|
284
|
+
* session's encoding. Argument is the `SUPPORTED_SERVER_ENCODINGS`
|
|
285
|
+
* spelling. Raised by MudSession for ScriptingAPI to save to the profile,
|
|
286
|
+
* as cTelnet does with `setEncoding(acceptedEncoding, true)`. */
|
|
287
|
+
'charset.accepted': [encoding: string];
|
|
210
288
|
'ping': [duration: number | null];
|
|
211
289
|
'script.log': [text: string, level: 'error' | 'info', source?: ScriptLogSource];
|
|
212
290
|
'output.ready': void;
|
|
213
291
|
'script.deleteline': void;
|
|
214
292
|
'script.clearwindow': void;
|
|
215
293
|
'script.appendcmd': [text: string];
|
|
216
|
-
|
|
294
|
+
/** `selectAll`: sendCmdLine and link PROMPTs select what they put there;
|
|
295
|
+
* printCmdLine and appendCmdLine leave the caret at the end. */
|
|
296
|
+
'script.setcmd': [text: string, selectAll?: boolean];
|
|
217
297
|
'script.clearcmd': void;
|
|
218
298
|
'script.selectcmd': void;
|
|
219
299
|
'script.cmdlinesuggestions': [items: string[]];
|
|
@@ -227,7 +307,6 @@ export type MudEvents = MudClientEvents & {
|
|
|
227
307
|
* (ProfileSession) shows the in-app VFS picker and resolves the request
|
|
228
308
|
* via `request.onPick`. See {@link FileDialogRequest}. */
|
|
229
309
|
'script.filedialog': [request: FileDialogRequest];
|
|
230
|
-
'prompt': void;
|
|
231
310
|
'script.movecursorup': void;
|
|
232
311
|
'script.movecursordown': void;
|
|
233
312
|
/** A Mudlet-format replay started playing. Payload is the recording's
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/** How a game installs its own full interface (Mudlet's `GameDetail::OwnUi`,
|
|
2
|
+
* less `None`). */
|
|
3
|
+
export type GameOwnUi = 'bundledLoader' | 'clientGui';
|
|
1
4
|
/** One entry of Mudlet's bundled-game catalogue (its C++ `GameDetail`). */
|
|
2
5
|
export interface BundledGame {
|
|
3
6
|
name: string;
|
|
@@ -13,9 +16,11 @@ export interface BundledGame {
|
|
|
13
16
|
* the bundler only emits assets it can see referenced. */
|
|
14
17
|
iconFile?: string;
|
|
15
18
|
description: string;
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
|
|
19
|
+
/** How the game installs its own full interface, if it does (Mudlet's
|
|
20
|
+
* `GameDetail::OwnUi`): `bundledLoader` — a loader bundled with Mudlet
|
|
21
|
+
* fetches it; `clientGui` — the game sends a Client.GUI package, often
|
|
22
|
+
* only after login. Absent means neither (`OwnUi::None`). */
|
|
23
|
+
ownUi?: GameOwnUi;
|
|
19
24
|
/** Other hostnames the game answers on. */
|
|
20
25
|
alternateHostUrls?: string[];
|
|
21
26
|
}
|
|
@@ -23,7 +28,7 @@ export declare const BUNDLED_GAMES: readonly BundledGame[];
|
|
|
23
28
|
/** The bundled game called `name`, matched the way Mudlet matches it
|
|
24
29
|
* (TGameDetails::findGame — exact, case-sensitive). */
|
|
25
30
|
export declare function findBundledGame(name: string): BundledGame | null;
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
* TGameDetails::
|
|
29
|
-
export declare function
|
|
31
|
+
/** How the game reachable at `hostUrl` (or any of its alternate hostnames,
|
|
32
|
+
* case-insensitively) installs its own full interface — `'none'` when it
|
|
33
|
+
* doesn't, or isn't a bundled game at all. Mudlet's TGameDetails::gameOwnUi. */
|
|
34
|
+
export declare function gameOwnUi(hostUrl: string): GameOwnUi | 'none';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type BundledGame } from './bundledGames';
|
|
2
|
+
import type { MudConnection } from '../../storage';
|
|
3
|
+
/**
|
|
4
|
+
* Deep links into the bundled-game catalogue, so a page elsewhere (mudlet.org's
|
|
5
|
+
* game list, a MUD's own site) can hand someone a "Play Astaria" button that
|
|
6
|
+
* lands them in the client with that game already picked.
|
|
7
|
+
*
|
|
8
|
+
* The link never creates anything on its own: the landing screen offers the
|
|
9
|
+
* player's existing profiles for the game and a prefilled Add form, the same
|
|
10
|
+
* choice a click on the game's tile gives. A bookmarked link is therefore safe
|
|
11
|
+
* to open repeatedly — it can't quietly pile up profiles.
|
|
12
|
+
*/
|
|
13
|
+
/** Query parameter carrying the game — `?play=astaria`. */
|
|
14
|
+
export declare const GAME_LINK_PARAM = "play";
|
|
15
|
+
/** URL-safe id for a game name: lowercase, runs of anything else collapsed to
|
|
16
|
+
* a single dash. "Avalon.de" → `avalon-de`, "God Wars II" → `god-wars-ii`.
|
|
17
|
+
* No two catalogue entries share a slug (pinned by a test). */
|
|
18
|
+
export declare function gameSlug(name: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* The games this client offers — listed in the grid, and the only ones a
|
|
21
|
+
* `?play=` link resolves to. Sorted by name, which is the order the grid draws
|
|
22
|
+
* them in.
|
|
23
|
+
*/
|
|
24
|
+
export declare const PLAYABLE_GAMES: readonly BundledGame[];
|
|
25
|
+
/** The playable game a `?play=` value names. Accepts the slug or the exact
|
|
26
|
+
* name (`?play=Avalon.de` works as well as `?play=avalon-de`), so a hand-written
|
|
27
|
+
* link doesn't have to know the slugging rule. Null for anything else. */
|
|
28
|
+
export declare function findGameByLink(value: string | null | undefined): BundledGame | null;
|
|
29
|
+
/** The link that opens `game` in a client hosted at `base`. What you paste into
|
|
30
|
+
* a "Play <game>" button on a website. */
|
|
31
|
+
export declare function gameLinkUrl(game: BundledGame, base: string): string;
|
|
32
|
+
/** The player's existing profiles for `game`, in launcher order. */
|
|
33
|
+
export declare function profilesForGame(game: BundledGame, connections: MudConnection[]): MudConnection[];
|
|
34
|
+
/** The bundled game a profile is for, or null if it isn't one of them. What
|
|
35
|
+
* lets the launcher draw the game's logo on a profile that carries no icon of
|
|
36
|
+
* its own — including one renamed, or created as a second "Achaea (2)". */
|
|
37
|
+
export declare function findGameForConnection(connection: MudConnection): BundledGame | null;
|
|
38
|
+
/** The connection record a game turns into. Mudlet's catalogue is host/port, so
|
|
39
|
+
* these are proxied `mud` profiles — the same thing the Add form builds. */
|
|
40
|
+
export declare function connectionFromGame(game: BundledGame): Omit<MudConnection, 'id'>;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BundledGame } from './bundledGames';
|
|
2
|
+
/**
|
|
3
|
+
* Mudlet's catalogue carries each game's off-site links as a small HTML
|
|
4
|
+
* fragment (`websiteInfo`), which desktop drops straight into a `website_entry`
|
|
5
|
+
* label (`dlgConnectionProfiles.cpp`). A browser must not do the same: the
|
|
6
|
+
* fragment is vendored upstream data, and injecting foreign HTML into the page
|
|
7
|
+
* to render two anchors is a poor trade. So we read the anchors out and let the
|
|
8
|
+
* caller render real elements.
|
|
9
|
+
*/
|
|
10
|
+
export interface GameLink {
|
|
11
|
+
/** Anchor text as shown — "Website", "Forum", "Discord". */
|
|
12
|
+
label: string;
|
|
13
|
+
href: string;
|
|
14
|
+
}
|
|
15
|
+
/** The off-site links a game's `websiteInfo` names, in the order it lists them.
|
|
16
|
+
* Anchors with no label, no usable href, or a duplicate href are dropped. */
|
|
17
|
+
export declare function parseWebsiteLinks(websiteInfo: string | undefined): GameLink[];
|
|
18
|
+
/** Whether `game` should show for a catalogue filter of `query`. Matches the
|
|
19
|
+
* name, the address and the blurb, so both "achaea" and "roleplay" find
|
|
20
|
+
* something; an empty query matches everything. */
|
|
21
|
+
export declare function gameMatchesQuery(game: BundledGame, query: string): boolean;
|
|
@@ -7,18 +7,63 @@ export interface KeyCodeInfo {
|
|
|
7
7
|
keyCode: number;
|
|
8
8
|
modifiers: number;
|
|
9
9
|
}
|
|
10
|
+
/** A permanent key's getKeyCode answer: the Qt::Key it was made with when
|
|
11
|
+
* known, else its code's, and the mask with the Keypad bit a Numpad* code
|
|
12
|
+
* implies. A group has no key of its own, and a code outside Qt's range — a
|
|
13
|
+
* group's -1 in a package, or a number no key has — reads as Key_unknown, as
|
|
14
|
+
* desktop's TKey keeps it. */
|
|
15
|
+
export declare function permKeyCode(node: Pick<KeyNode, 'key' | 'modifiers' | 'qtKey'> & {
|
|
16
|
+
isGroup?: boolean;
|
|
17
|
+
}): KeyCodeInfo;
|
|
10
18
|
export declare class KeyEngine {
|
|
11
19
|
private readonly temp;
|
|
12
20
|
private perm;
|
|
13
21
|
/** Shared with every other engine in the profile — see ItemIdSequence. */
|
|
14
22
|
private idSeq;
|
|
15
23
|
setIdSequence(seq: ItemIdSequence): void;
|
|
16
|
-
|
|
17
|
-
|
|
24
|
+
private regCounter;
|
|
25
|
+
private readonly permReg;
|
|
26
|
+
/** Each key in {@link perm} → the seq of the root it hangs under. */
|
|
27
|
+
private permRootSeq;
|
|
28
|
+
/** Temp keys in the tree (Mudlet `getProfileStats` temp count) — killed
|
|
29
|
+
* ones too, until the cleanup frees them: KeyUnit::assembleReport walks
|
|
30
|
+
* the tree, and a killed key stays in it until doCleanup(). */
|
|
18
31
|
get tempCount(): number;
|
|
32
|
+
/** Of {@link tempCount}, the keys that are still active. */
|
|
33
|
+
get tempActiveCount(): number;
|
|
34
|
+
/** Each permanent key hanging off a temporary one (as of the last
|
|
35
|
+
* loadPerm) → that temporary root's id; and the parent refs in use. */
|
|
36
|
+
private permTempRoot;
|
|
37
|
+
private tempParentRefs;
|
|
38
|
+
private orphanedParents;
|
|
39
|
+
private onOrphans;
|
|
40
|
+
/** Tree keys of freed temp keys that had permanent children, since the
|
|
41
|
+
* last call. Their owner removes those subtrees from the store. */
|
|
42
|
+
takeOrphanedParents(): string[];
|
|
43
|
+
/** Told when {@link takeOrphanedParents} has something to hand over. */
|
|
44
|
+
setOrphanListener(fn: (() => void) | null): void;
|
|
45
|
+
/** In the tree and not killed — what exists() and findItems() count. */
|
|
46
|
+
hasLiveTemp(id: number): boolean;
|
|
47
|
+
/** Live, switched on and compiled — isActive(). */
|
|
48
|
+
tempIsActive(id: number): boolean;
|
|
49
|
+
/** Live temp key ids, ascending, whose name — the id itself — passes `test`. */
|
|
50
|
+
liveTempIds(test: (name: string) => boolean): number[];
|
|
51
|
+
/** The temp key named `name` — a temp key is named after its id — or
|
|
52
|
+
* null; a killed one only when `includeDead` (perm* parent resolution). */
|
|
53
|
+
newestTempByName(name: string, includeDead: boolean): number | null;
|
|
54
|
+
/** `killKey(name)` for the temporaries. */
|
|
55
|
+
killTempByName(name: string): boolean;
|
|
56
|
+
/** The order seq of a permanent key's root — for one hanging off a
|
|
57
|
+
* temporary key, that key's. */
|
|
58
|
+
private rootSeqOf;
|
|
59
|
+
/** Whether a permanent key is reached at all: under a temporary key only
|
|
60
|
+
* while that key is active (TKey::match tests its children only then). */
|
|
61
|
+
private reachable;
|
|
19
62
|
addTemp(key: string, modifiers: string[], fn: TempFn, qt?: {
|
|
20
63
|
keyCode: number;
|
|
21
64
|
modifier: number;
|
|
65
|
+
uncompiled?: boolean;
|
|
66
|
+
onFree?: () => void;
|
|
22
67
|
}): number;
|
|
23
68
|
/** Whether a temp key with this id is live — backs exists(id, "key"). */
|
|
24
69
|
hasTemp(id: number): boolean;
|
|
@@ -36,8 +81,69 @@ export declare class KeyEngine {
|
|
|
36
81
|
/** Free every key killed since the last call. Runs once per processed line
|
|
37
82
|
* batch, mirroring the deferred cleanup Mudlet's TKeyUnit does. */
|
|
38
83
|
reapKilled(): void;
|
|
39
|
-
|
|
40
|
-
|
|
84
|
+
/** @param all Mudlet's "React to all keybindings on the same key": run
|
|
85
|
+
* every enabled match instead of stopping at the first. Snapshot the
|
|
86
|
+
* values first — a handler may create or kill a temp key, and mutating the
|
|
87
|
+
* map mid-iteration is exactly the case Mudlet's deferred `reapKilled`
|
|
88
|
+
* exists to avoid. */
|
|
89
|
+
processTemp(event: KeyboardEvent, all?: boolean): boolean;
|
|
90
|
+
/** Run one temp key if it is live and `event` is its key. */
|
|
91
|
+
private fireTemp;
|
|
92
|
+
/**
|
|
93
|
+
* A keypress's whole key pass: temporary and permanent keys alike, in the
|
|
94
|
+
* one order desktop's `mKeyRootNodeList` holds them (creation order, see
|
|
95
|
+
* the unified-ordering note above). The first match fires and ends the
|
|
96
|
+
* pass, unless `all` (Mudlet's "React to all keybindings on the same key")
|
|
97
|
+
* asks for every match. Running all the temps first put a tempKey made
|
|
98
|
+
* after a permKey ahead of it (mudlet-web#340). Temps fire themselves; a
|
|
99
|
+
* permanent hit goes to `firePerm`. Both lists are snapshots taken when the
|
|
100
|
+
* pass began — a handler may make, kill or toggle keys. True when anything
|
|
101
|
+
* fired.
|
|
102
|
+
*/
|
|
103
|
+
process(event: KeyboardEvent, all: boolean, firePerm: (binding: KeyNode) => void): boolean;
|
|
104
|
+
/** `blocked`: bindings whose code will not compile, which Mudlet leaves
|
|
105
|
+
* inactive — see buildEffectivelyEnabledIds. */
|
|
106
|
+
loadPerm(keybindings: KeyNode[], blocked?: ReadonlySet<string>): void;
|
|
107
|
+
/** Every saved binding with a key, switched on or not — see {@link holderOf}. */
|
|
108
|
+
private permHolders;
|
|
109
|
+
/**
|
|
110
|
+
* Give the profile's saved keys their place in the firing order before any
|
|
111
|
+
* script can make a temporary one. Desktop builds them from the profile
|
|
112
|
+
* before a script runs, so a tempKey a script makes at load time sorts
|
|
113
|
+
* after them — but here the scripts run before the first {@link loadPerm},
|
|
114
|
+
* which then reuses the seqs reserved here.
|
|
115
|
+
*/
|
|
116
|
+
reserveOrder(items: readonly {
|
|
117
|
+
id: string;
|
|
118
|
+
}[]): void;
|
|
119
|
+
/** The first permanent keybinding the event matches, in tree order — the
|
|
120
|
+
* permanent half of {@link process}, for callers that ask about the
|
|
121
|
+
* saved keys alone. */
|
|
41
122
|
matchPerm(event: KeyboardEvent): KeyNode | null;
|
|
123
|
+
/** Every permanent keybinding the event matches, in tree order. The list
|
|
124
|
+
* form of {@link matchPerm}, for Mudlet's "React to all keybindings on the
|
|
125
|
+
* same key". */
|
|
126
|
+
matchAllPerm(event: KeyboardEvent): KeyNode[];
|
|
127
|
+
/**
|
|
128
|
+
* Which binding of this profile holds `key` + `modifiers` — Mudlet's
|
|
129
|
+
* `KeyUnit::firstMatch`, asked with a key rather than an event.
|
|
130
|
+
*
|
|
131
|
+
* What needs it is `addCommand`: a key binding is the one holder a
|
|
132
|
+
* command's shortcut cannot see, since it lives here and is matched from
|
|
133
|
+
* the command line's key handling rather than by any menu or widget, so a
|
|
134
|
+
* command placed on a binding's key takes the event and the binding simply
|
|
135
|
+
* stops firing. Temporary and permanent are searched alike (they are one
|
|
136
|
+
* list in Mudlet's key unit), and a temporary one answers with no name: it
|
|
137
|
+
* is named after its own id, which names nothing a player could go and look
|
|
138
|
+
* for.
|
|
139
|
+
*
|
|
140
|
+
* A switched-off binding still holds its key — on its own or through its
|
|
141
|
+
* group — since scripts switch bindings on and off and enableKey() does not
|
|
142
|
+
* look for commands; one killed does not, as it can never fire again.
|
|
143
|
+
*/
|
|
144
|
+
holderOf(key: string, modifiers: string[]): {
|
|
145
|
+
name: string;
|
|
146
|
+
temporary: boolean;
|
|
147
|
+
} | null;
|
|
42
148
|
destroy(): void;
|
|
43
149
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Some keyboard shortcuts are owned by the browser (or the OS) and are handled
|
|
3
3
|
* *above* the web page — Ctrl+T opens a new tab, Ctrl+W closes it, F12 opens
|
|
4
4
|
* devtools. The page never receives the keydown (or can't suppress it), so a MUD
|
|
5
|
-
* keybinding on one of these can never fire in
|
|
5
|
+
* keybinding on one of these can never fire in mudlet.
|
|
6
6
|
*
|
|
7
7
|
* Real Mudlet runs natively and binds these freely; opened in a browser they
|
|
8
8
|
* silently do nothing, which is baffling. We scan the loaded keybindings on
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* We deliberately do NOT warn about page-level shortcuts the browser owns but a
|
|
13
13
|
* page can still capture with preventDefault — Ctrl+R (reload), Ctrl+S (save),
|
|
14
|
-
* Ctrl+P (print), Ctrl+F (find), F5, Ctrl+L, etc.
|
|
14
|
+
* Ctrl+P (print), Ctrl+F (find), F5, Ctrl+L, etc. Mudlet Web intercepts those, so they
|
|
15
15
|
* work exactly like they do in Mudlet: while the client has keyboard focus.
|
|
16
16
|
*
|
|
17
17
|
* Keys are stored as DOM `KeyboardEvent.code` strings (see {@link KeyNode}), so we
|
|
@@ -10,8 +10,69 @@
|
|
|
10
10
|
* Typing a command is the app's resting state, not a text-entry mode that
|
|
11
11
|
* should own every hotkey.
|
|
12
12
|
*
|
|
13
|
+
* The command lines scripts make are command lines too, not text entry:
|
|
14
|
+
* `createCommandLine` (and Geyser.CommandLine on top of it) and a miniconsole's
|
|
15
|
+
* or user window's `enableCommandLine`. Every desktop TCommandLine — main,
|
|
16
|
+
* SubCommandLine and ConsoleCommandLine alike — runs the same `event()`, which
|
|
17
|
+
* offers its keys to the KeyUnit, so a binding fires from any of them.
|
|
18
|
+
*
|
|
13
19
|
* Real text entry elsewhere — the Lua script editor (CodeMirror, so
|
|
14
20
|
* `contentEditable`), a modal's form field, the script tree's filter box —
|
|
15
21
|
* does keep the event to itself.
|
|
16
22
|
*/
|
|
17
23
|
export declare function isTextEntryTarget(target: EventTarget | null): boolean;
|
|
24
|
+
/** Whether `target` is a command line — the main one or a script-made one. */
|
|
25
|
+
export declare function isCommandLineTarget(target: EventTarget | null): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Whether the command line claims `e` for itself before any keybinding sees it.
|
|
28
|
+
*
|
|
29
|
+
* Desktop's `TCommandLine::event` handles these combinations outright and only
|
|
30
|
+
* offers a key to the keybinding engine when it is pressed with some OTHER set
|
|
31
|
+
* of modifiers — so a binding on plain Up never fires from the command line,
|
|
32
|
+
* while one on Alt+Up does:
|
|
33
|
+
*
|
|
34
|
+
* - Return: plain (send), Ctrl (clearSplit), Shift (newline)
|
|
35
|
+
* - Up/Down: plain (history), Ctrl (move the caret between rows)
|
|
36
|
+
* - Tab and Space: plain or Shift (completion, typing)
|
|
37
|
+
* - Backspace: plain, Ctrl and/or Shift (editing)
|
|
38
|
+
* - Escape, PageUp, PageDown, Delete: plain
|
|
39
|
+
*
|
|
40
|
+
* Cmd counts as Ctrl, as Qt maps it on macOS.
|
|
41
|
+
*
|
|
42
|
+
* None of that holds on the numpad. Qt reports a numpad key with
|
|
43
|
+
* KeypadModifier set, so "plain" Enter or Up there is not plain to
|
|
44
|
+
* TCommandLine: numpad Enter and NumLock-off numpad 8/2/9 reach the key unit
|
|
45
|
+
* first, and a Keypad+Enter or Keypad+Up binding fires instead of sending the
|
|
46
|
+
* command or walking the history. With no binding on the key the command line
|
|
47
|
+
* still gets it (the keybinding listener lets the event through), so numpad
|
|
48
|
+
* Enter sends as before.
|
|
49
|
+
*/
|
|
50
|
+
export declare function commandLineReservesKey(e: KeyboardEvent): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Wire the keybinding engine to `doc`'s keydown events; returns the cleanup.
|
|
53
|
+
*
|
|
54
|
+
* Keys typed into the command line are offered in the CAPTURE phase, before
|
|
55
|
+
* CommandBar's own handler runs, and a binding that fires consumes the key —
|
|
56
|
+
* desktop's TCommandLine::event asks the key unit first and stops there, so a
|
|
57
|
+
* bound Alt+Return must not also stage a newline (and send an empty command
|
|
58
|
+
* with the next Enter). The combinations the command line reserves (see
|
|
59
|
+
* {@link commandLineReservesKey}) never reach a binding from there.
|
|
60
|
+
*
|
|
61
|
+
* That capture listener sits on the WINDOW, not the document. The client's own
|
|
62
|
+
* shortcuts (Ctrl+F's find bar, Ctrl+Shift+P's quick-open, F3) are capture
|
|
63
|
+
* listeners on the document, and `stopPropagation` does not stop a sibling
|
|
64
|
+
* listener on the same node — so with both on the document a binding on one of
|
|
65
|
+
* those keys ran AND opened the find bar, which then took focus and the rest
|
|
66
|
+
* of the typing (mudlet-web#340). The window's capture runs before any of them,
|
|
67
|
+
* and a binding that fires stops the event there, as desktop's binding
|
|
68
|
+
* replaces the find bar.
|
|
69
|
+
*
|
|
70
|
+
* The exception is a menu accelerator (`yieldTo`): on desktop Alt+K is a
|
|
71
|
+
* QAction's shortcut, which Qt resolves before the command line ever sees the
|
|
72
|
+
* key, so a binding on it does not run. A key `yieldTo` claims is left alone.
|
|
73
|
+
*
|
|
74
|
+
* Everywhere else keeps a bubble-phase listener, so a modal's own key handling
|
|
75
|
+
* still gets first say, and real text entry (see {@link isTextEntryTarget})
|
|
76
|
+
* keeps its keys.
|
|
77
|
+
*/
|
|
78
|
+
export declare function listenForKeybindings(doc: Document, processKey: (e: KeyboardEvent) => boolean, yieldTo?: (e: KeyboardEvent) => boolean): () => void;
|