@mudlet/mudlet-web 0.5.0 → 1.0.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.
- 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 +22 -14
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WindowOpenOptions } from '../ui/windows/types';
|
|
2
2
|
import type { MudletVariable } from '../import/mudletVariables';
|
|
3
|
-
export declare const DEFAULT_PROXY_URL = "wss://
|
|
3
|
+
export declare const DEFAULT_PROXY_URL = "wss://web-proxy.mudlet.org";
|
|
4
4
|
export type ConnectionMode = 'mud' | 'websocket';
|
|
5
5
|
export interface MudConnection {
|
|
6
6
|
id: string;
|
|
@@ -15,6 +15,20 @@ export interface MudConnection {
|
|
|
15
15
|
* `undefined`/`false` = open offline (default); the "Connect" button always
|
|
16
16
|
* dials regardless. */
|
|
17
17
|
autoReconnect?: boolean;
|
|
18
|
+
/** Mudlet's *other* connection option, `autoreconnect` (read per profile in
|
|
19
|
+
* `Host.cpp:344-345`, written by
|
|
20
|
+
* `dlgConnectionProfiles::slot_updateAutoReconnect`): when a connection
|
|
21
|
+
* that had settled drops for any reason the user didn't ask for, redial it
|
|
22
|
+
* once, straight away and silently (`cTelnet::slot_socketDisconnected`,
|
|
23
|
+
* ctelnet.cpp:918-923).
|
|
24
|
+
*
|
|
25
|
+
* {@link autoReconnect} above is Mudlet's `autologin` in spite of its name
|
|
26
|
+
* — it only decides whether *opening* the profile dials — and renaming it
|
|
27
|
+
* would orphan every existing profile unless something moved them, the
|
|
28
|
+
* way `storageMigration.ts` moved the storage keys. Nobody has written that
|
|
29
|
+
* for this field, so the second option gets a name of its own. See
|
|
30
|
+
* `hooks/useAutoReconnect`. */
|
|
31
|
+
reconnectOnDrop?: boolean;
|
|
18
32
|
/** Profile icon shown on the connection-selection screen (Mudlet's profile
|
|
19
33
|
* icon, set by setProfileIcon / read by getProfileIcon / cleared by
|
|
20
34
|
* resetProfileIcon). Stored as a self-contained `data:` URI. Lives on the
|
|
@@ -56,6 +70,12 @@ export interface MudConnection {
|
|
|
56
70
|
* profiles created after it shipped, and never lands on top of a layout
|
|
57
71
|
* someone already built. See `stockDefaults`. */
|
|
58
72
|
createdAt?: string;
|
|
73
|
+
/** When this profile last reached its game (ms since epoch), stamped on
|
|
74
|
+
* `client.established` — a socket that opened but never got through to the
|
|
75
|
+
* game, or a profile opened offline, doesn't count. Orders the launcher
|
|
76
|
+
* (most recent first, the newest in the "Continue playing" banner). Absent
|
|
77
|
+
* means never played since the field shipped. */
|
|
78
|
+
lastConnectedAt?: number;
|
|
59
79
|
/** Connect to the game over TLS — Mudlet's `mSslTsl` / the connection
|
|
60
80
|
* dialog's "secure connection" checkbox. Meaningful in `mud` (proxy) mode
|
|
61
81
|
* only: the browser cannot wrap a raw socket itself, so the proxy performs
|
|
@@ -125,6 +145,16 @@ export interface ClientSettings {
|
|
|
125
145
|
* triggered (a real user gesture), so the first script notification can fire
|
|
126
146
|
* without a surprise permission pop-up. */
|
|
127
147
|
notificationsEnabled?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Keyboard-shortcut overrides, keyed by `AppCommandId` (see
|
|
150
|
+
* `ui/commands/appShortcuts.ts`), each a Qt-style sequence such as
|
|
151
|
+
* "Ctrl+Alt+L". Application-wide rather than per-profile, as Mudlet's are.
|
|
152
|
+
*
|
|
153
|
+
* An id that is absent uses the default for the platform. An id present
|
|
154
|
+
* with an empty string is a binding the player deliberately cleared, which
|
|
155
|
+
* is not the same thing — clearing has to survive a default changing.
|
|
156
|
+
*/
|
|
157
|
+
shortcuts?: Record<string, string>;
|
|
128
158
|
}
|
|
129
159
|
/** Per-profile settings. Scripts (setBorder, setFont, setBackgroundColor, …) and
|
|
130
160
|
* the in-profile settings modal write here. Each field's value falls through to
|
|
@@ -155,6 +185,11 @@ export interface ProfileSettings {
|
|
|
155
185
|
* ("Allow secure connection reminder"), settable from Lua via
|
|
156
186
|
* `setProfileConfig("askTlsAvailable", …)`. */
|
|
157
187
|
askTlsAvailable?: boolean;
|
|
188
|
+
/** Which engine the console's "Search on …" context-menu entry uses. A key
|
|
189
|
+
* of {@link SEARCH_ENGINES}; anything else (or undefined) falls back to
|
|
190
|
+
* {@link DEFAULT_SEARCH_ENGINE}, the way Mudlet's `Host::getSearchEngine`
|
|
191
|
+
* does. Per-profile, because Mudlet keeps it on the Host. */
|
|
192
|
+
searchEngine?: string;
|
|
158
193
|
showTimestamps: boolean;
|
|
159
194
|
fontSize: number;
|
|
160
195
|
outputBackground: string;
|
|
@@ -169,8 +204,10 @@ export interface ProfileSettings {
|
|
|
169
204
|
/** Background color for the local echo of commands you send. Empty/undefined = none. */
|
|
170
205
|
commandEchoBackground?: string;
|
|
171
206
|
outputFont?: OutputFontSource;
|
|
172
|
-
/** Mudlet setWindowWrap("main", N).
|
|
173
|
-
*
|
|
207
|
+
/** Mudlet setWindowWrap("main", N) — Host::mWrapAt. Defaults to 100, as on
|
|
208
|
+
* desktop: lines longer than it are stored and drawn as several lines. 0
|
|
209
|
+
* turns the character wrap off (text fills the window width), a Mudlet Web
|
|
210
|
+
* escape hatch the Settings field offers and setWindowWrap refuses. */
|
|
174
211
|
outputWrapAt?: number;
|
|
175
212
|
/** Mudlet setWindowWrapIndent("main", N). Indent (chars) of newline-started lines. */
|
|
176
213
|
outputWrapIndent?: number;
|
|
@@ -211,8 +248,8 @@ export interface ProfileSettings {
|
|
|
211
248
|
* the built-in default). `undefined` for the whole array = no override. */
|
|
212
249
|
ansiPalette?: (string | undefined)[];
|
|
213
250
|
/** Mudlet "Allow server to redefine your colors". When enabled, the server
|
|
214
|
-
* may remap the ANSI
|
|
215
|
-
* (reset). When disabled, those sequences are ignored and the user palette
|
|
251
|
+
* may remap the sixteen ANSI colours at runtime via `ESC]P<i><rrggbb>` (set
|
|
252
|
+
* colour) / `ESC]R` (reset). When disabled, those sequences are ignored and the user palette
|
|
216
253
|
* stands. Off by default — only an explicit `true` enables it. */
|
|
217
254
|
serverRedefineColors?: boolean;
|
|
218
255
|
/** Mudlet 5.0's `Host::mEnableOSC8Hyperlinks` ("Enable OSC 8 hyperlinks").
|
|
@@ -224,7 +261,7 @@ export interface ProfileSettings {
|
|
|
224
261
|
* flipped would never end. On by default: only an explicit `false`
|
|
225
262
|
* disables it, matching Mudlet's `= true` default. Unlike most of these,
|
|
226
263
|
* Mudlet exposes no `setConfig` key for it — preferences and the profile
|
|
227
|
-
* XML only — so
|
|
264
|
+
* XML only — so Mudlet Web doesn't invent one either. */
|
|
228
265
|
osc8Hyperlinks?: boolean;
|
|
229
266
|
/** Mudlet 5.0's `Host::mUndoServerWrap` ("Undo the game's own wrapping",
|
|
230
267
|
* experimental). Rejoins the lines a game hard-wrapped itself before
|
|
@@ -236,11 +273,80 @@ export interface ProfileSettings {
|
|
|
236
273
|
* `mUndoServerWrapWidth`, bounded 20–500 and defaulting to 80 (very often
|
|
237
274
|
* the right answer). `setConfig("undoServerWrapWidth", …)`. */
|
|
238
275
|
undoServerWrapWidth?: number;
|
|
276
|
+
/** Mudlet's `Host::mConsoleBufferSize` ("Main display size") — how many
|
|
277
|
+
* lines of scrollback the main output keeps before the oldest are dropped
|
|
278
|
+
* in batches. Bounded 100 … 1,000,000; `undefined` uses
|
|
279
|
+
* {@link MAIN_CONSOLE_BUFFER_SIZE} (100,000 lines, `Host.h`).
|
|
280
|
+
* Round-trips through the profile XML as `consoleBufferSize`
|
|
281
|
+
* (XMLexport.cpp:617). `setConsoleBufferSize("main", …)` writes it (and
|
|
282
|
+
* {@link useMaxConsoleBufferSize}) back, as desktop's
|
|
283
|
+
* `Host::setMainConsoleBufferSize` does, so a script's size is saved. */
|
|
284
|
+
consoleBufferSize?: number;
|
|
285
|
+
/** Mudlet's `Host::mUseMaxConsoleBufferSize` ("use the maximum buffer size
|
|
286
|
+
* your system can handle", `checkBox_useMaxBufferSize`). When true the
|
|
287
|
+
* configured {@link consoleBufferSize} is ignored in favour of the ceiling.
|
|
288
|
+
* Desktop derives that ceiling from physical memory
|
|
289
|
+
* (`TBuffer::getMaxBufferSize()`); a browser tab cannot ask, so Mudlet Web uses
|
|
290
|
+
* a fixed 1,000,000-line cap. Off unless explicitly true. */
|
|
291
|
+
useMaxConsoleBufferSize?: boolean;
|
|
239
292
|
/** Mudlet "Network packet timeout": how long (ms) to buffer a partial line
|
|
240
293
|
* (text after the last `\n` of a WebSocket frame) before flushing it as a
|
|
241
294
|
* prompt. Mitigates spurious mid-line breaks when long MUD lines arrive
|
|
242
295
|
* fragmented. `undefined` = use MudClient's built-in default (300ms). */
|
|
243
296
|
promptTimeoutMs?: number;
|
|
297
|
+
/** Mudlet's "Server data encoding": how the game's bytes are decoded into
|
|
298
|
+
* text, for games that don't negotiate CHARSET. One of
|
|
299
|
+
* `SUPPORTED_SERVER_ENCODINGS`, spelled as that list spells it. Applied on
|
|
300
|
+
* profile open and carried across reconnects by `MudSession`. A script's
|
|
301
|
+
* `setServerEncoding()` rewrites it, and so does an encoding the client
|
|
302
|
+
* ACCEPTs from a server's CHARSET REQUEST when that changes the encoding —
|
|
303
|
+
* both as cTelnet::setEncoding(…, true) saves it in Mudlet. A REJECTED
|
|
304
|
+
* request leaves it alone. Older saves may say `CP1161` — see
|
|
305
|
+
* `savedServerEncoding`. `undefined` = UTF-8. */
|
|
306
|
+
serverEncoding?: string;
|
|
307
|
+
/** Mudlet's "Highlight history": a command recalled with Up/Down comes back
|
|
308
|
+
* selected rather than with the caret at its end, so the next keystroke
|
|
309
|
+
* replaces it, and Up/Down with typed text searches history by prefix.
|
|
310
|
+
* On unless explicitly false, as on desktop (XMLimport's
|
|
311
|
+
* readDefaultTrueBool). */
|
|
312
|
+
highlightHistory?: boolean;
|
|
313
|
+
/** Mudlet's "Disable password masking": show the characters in the command
|
|
314
|
+
* line while the game has echo off. Off unless explicitly true. */
|
|
315
|
+
disablePasswordMasking?: boolean;
|
|
316
|
+
/** Mudlet's "React to all keybindings on the same key": when several
|
|
317
|
+
* keybindings share a key and modifiers, run every enabled one instead of
|
|
318
|
+
* stopping at the first that matches. Off unless explicitly true. */
|
|
319
|
+
reactToAllKeybindings?: boolean;
|
|
320
|
+
/** Mudlet's "Stop selecting a word on these characters": the extra
|
|
321
|
+
* characters a double-click treats as a word boundary in the main display.
|
|
322
|
+
* Empty or unset uses the browser's own word rules. */
|
|
323
|
+
doubleClickIgnore?: string;
|
|
324
|
+
/** Mudlet's "Make 'Ambiguous' E. Asian width characters wide": render the
|
|
325
|
+
* Unicode East Asian *Ambiguous* characters (box-drawing glyphs, ★ ♠ and
|
|
326
|
+
* friends) two columns wide instead of one. A tri-state, like Mudlet's
|
|
327
|
+
* checkbox: true or false is a chosen width, unset is "auto" — wide only
|
|
328
|
+
* for the CJK server encodings (see effectiveAmbiguousWidthWide). Read and
|
|
329
|
+
* written by `get/setConfig("ambiguousEAsianWidthCharacters")` as well. */
|
|
330
|
+
ambiguousWidthWide?: boolean;
|
|
331
|
+
/** Mudlet's "Enable text analyzer" (`Host::mEnableTextAnalyzer`): put an
|
|
332
|
+
* "Analyse characters" entry on a console's right-click menu, reporting the
|
|
333
|
+
* UTF-16/UTF-8 encoding of the selected text. Off unless explicitly true,
|
|
334
|
+
* as on desktop — it is a diagnostic for a pattern that will not match, not
|
|
335
|
+
* something to carry in the menu every day. */
|
|
336
|
+
enableTextAnalyzer?: boolean;
|
|
337
|
+
/** Mudlet's "Expect Color Space Id in SGR...(3|4)8;2;...m codes": read
|
|
338
|
+
* 24-bit colour as `38;2;<id>;r;g;b` (the ITU T.416 spelling, with a
|
|
339
|
+
* colour-space id) rather than `38;2;r;g;b`. Off unless explicitly true. */
|
|
340
|
+
expectColorSpaceId?: boolean;
|
|
341
|
+
/** Mudlet's Editor preference page. Each field falls back to
|
|
342
|
+
* `EDITOR_OPTION_DEFAULTS` when unset. */
|
|
343
|
+
editor?: EditorSettings;
|
|
344
|
+
/** Mudlet's "System/Mudlet dictionary" spell-check switch, as near as a
|
|
345
|
+
* browser gets: turn the browser's own spellchecker on for the command
|
|
346
|
+
* line. Off unless explicitly true — a MUD command line is full of words
|
|
347
|
+
* no dictionary has, so red underlines everywhere is the wrong default.
|
|
348
|
+
* Never applied to the password field. */
|
|
349
|
+
spellCheckInput?: boolean;
|
|
244
350
|
/** Per-area MapPanel last-viewed z-level. Each area remembers which level
|
|
245
351
|
* you were on so switching between areas (or reopening the panel) restores
|
|
246
352
|
* it. Zoom is no longer kept here — it lives in the map file (per-area
|
|
@@ -254,6 +360,16 @@ export interface ProfileSettings {
|
|
|
254
360
|
* area on panel mount; the matching {@link mapViewStates} entry drives
|
|
255
361
|
* the initial level. Falls through to the first area in the map. */
|
|
256
362
|
mapLastAreaId?: number;
|
|
363
|
+
/** Mudlet's "report map issues on screen" (`mudlet::mShowMapAuditErrors`):
|
|
364
|
+
* post the map's sanity-check report on the main console when a map is
|
|
365
|
+
* loaded, instead of keeping it to itself. Off unless explicitly true, as
|
|
366
|
+
* on desktop — and the audit only runs at all when it is on, so a clean
|
|
367
|
+
* profile pays nothing for it on a large map.
|
|
368
|
+
*
|
|
369
|
+
* Desktop's alternative when this is off is a report file it points you at;
|
|
370
|
+
* there is no such file here (nothing writes outside the profile VFS on its
|
|
371
|
+
* own), so off means the report is simply not made. */
|
|
372
|
+
reportMapIssues?: boolean;
|
|
257
373
|
/** Whether the map widget's control bar — area picker, z-level buttons,
|
|
258
374
|
* options menu — is shown. Mudlet's `Host::mShowPanel`: toggled by the
|
|
259
375
|
* collapse arrow drawn over the map, readable/writable from Lua as
|
|
@@ -267,18 +383,35 @@ export interface ProfileSettings {
|
|
|
267
383
|
* enabled so existing profiles opt in without a migration; set to `false`
|
|
268
384
|
* to stop recording for this profile. */
|
|
269
385
|
loggingEnabled?: boolean;
|
|
386
|
+
/** The Notepad's send controls (Send all / line / selection, Prepend,
|
|
387
|
+
* Stop) are shown. Hidden unless set, as desktop keeps them
|
|
388
|
+
* (`Notepad/SendControlsVisible` in the profile's ini). */
|
|
389
|
+
notepadSendControls?: boolean;
|
|
270
390
|
/** Flash the browser tab title (Mudlet's taskbar-blink equivalent) when new
|
|
271
|
-
* server data arrives while the
|
|
391
|
+
* server data arrives while the Mudlet Web tab/window is unfocused. Off unless
|
|
272
392
|
* explicitly set to true. */
|
|
273
393
|
notifyOnNewData?: boolean;
|
|
274
394
|
/** Mirror script/trigger/alias/timer errors into the main output window (in
|
|
275
395
|
* red), in addition to the script editor's Errors tab. Mudlet's "Show
|
|
276
396
|
* errors in main console" preference. Off unless explicitly set to true. */
|
|
277
397
|
showErrorsInMainWindow?: boolean;
|
|
278
|
-
/**
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
|
|
398
|
+
/** Mudlet's menu-bar visibility (Settings → "Icons and toolbars"): the row
|
|
399
|
+
* holding the client's own menus. On unless explicitly set to false.
|
|
400
|
+
*
|
|
401
|
+
* Mudlet's setting has three values — never, only without a loaded
|
|
402
|
+
* profile, always — and the middle one describes a window this client does
|
|
403
|
+
* not have: the session screen only exists once a profile IS loaded, so
|
|
404
|
+
* "only without one" and "never" would be the same switch. Hence a
|
|
405
|
+
* two-state one. */
|
|
406
|
+
showMenuBar?: boolean;
|
|
407
|
+
/** The same for Mudlet's main toolbar — the row of buttons under the menus.
|
|
408
|
+
* On unless explicitly set to false.
|
|
409
|
+
*
|
|
410
|
+
* Never false at the same time as `showMenuBar`: a client with neither has
|
|
411
|
+
* no way back to its own settings, which is the clash Mudlet's preference
|
|
412
|
+
* guards against too (its "Never" entry greys out in one control while the
|
|
413
|
+
* other holds it). */
|
|
414
|
+
showToolbar?: boolean;
|
|
282
415
|
/** User-tunable subset of mudlet-map-renderer's Settings object. Fields
|
|
283
416
|
* are forwarded onto the live renderer.settings on mount and whenever
|
|
284
417
|
* the user changes them in the Mapper tab. Missing fields fall through
|
|
@@ -305,7 +438,7 @@ export interface ProfileSettings {
|
|
|
305
438
|
uninstalledPackages?: string[];
|
|
306
439
|
/** Catch-all bag for Mudlet `setConfig`/`getConfig` option keys that have no
|
|
307
440
|
* dedicated structured home above (accessibility, input-line, and other
|
|
308
|
-
* preferences
|
|
441
|
+
* preferences Mudlet Web persists for round-trip fidelity but does not yet act
|
|
309
442
|
* on). Keys with a structured home — protocol toggles, mapper settings,
|
|
310
443
|
* autoClearInput — are NOT stored here; the registry in ScriptingAPI reads
|
|
311
444
|
* and writes their real fields so the Settings UI stays in sync. Merged
|
|
@@ -369,7 +502,7 @@ export interface ProtocolSettings {
|
|
|
369
502
|
* `Sec-WebSocket-Protocol` header (RFC 6455), in preference order — the
|
|
370
503
|
* server selects at most one. These are mutually-exclusive stream *modes*,
|
|
371
504
|
* not layers (see {@link WS_SUBPROTOCOL_CHOICES}). Defaults to `['binary']`:
|
|
372
|
-
* the raw telnet stream over binary frames is exactly what
|
|
505
|
+
* the raw telnet stream over binary frames is exactly what Mudlet Web decodes,
|
|
373
506
|
* and `binary` is accepted by both FluffOS and servers like last-outpost.com.
|
|
374
507
|
* An empty list opens a bare socket (no header). Applies to direct
|
|
375
508
|
* `websocket`-mode connections; the bundled telnet proxy ignores it. */
|
|
@@ -383,18 +516,18 @@ export interface ProtocolSettings {
|
|
|
383
516
|
* never negotiate option 90, they just emit the tags); the tag bytes are
|
|
384
517
|
* legitimate text on non-MSP MUDs but that collision is rare in practice. */
|
|
385
518
|
export declare const PROTOCOL_DEFAULTS: Required<ProtocolSettings>;
|
|
386
|
-
/** The WebSocket subprotocol names
|
|
519
|
+
/** The WebSocket subprotocol names Mudlet Web can advertise, in canonical preference
|
|
387
520
|
* order. Mutually-exclusive stream modes the server picks *one* of — not
|
|
388
521
|
* layers that stack:
|
|
389
522
|
* - `binary` — raw telnet byte stream over WebSocket binary frames. Every byte
|
|
390
523
|
* (IAC, GMCP/MSDP, MCCP, high-bit charset) survives; this is the
|
|
391
|
-
* only mode
|
|
524
|
+
* only mode Mudlet Web's binary-frame decoder actually consumes.
|
|
392
525
|
* - `telnet` — FluffOS binds this to the same telnet handler as `binary`; an
|
|
393
526
|
* alternate name some servers register instead of `binary`.
|
|
394
527
|
* - `telnet.mudstandards.org` — the mudstandards.org WebSocket proposal, same
|
|
395
528
|
* on-the-wire profile under the standardised name.
|
|
396
529
|
* (`ascii` — text frames with telnet stripped — is deliberately omitted: it's a
|
|
397
|
-
* dumb-terminal mode
|
|
530
|
+
* dumb-terminal mode Mudlet Web can't decode.) The Settings UI renders one checkbox
|
|
398
531
|
* per entry; the selection is passed to MudClient in this order so the server
|
|
399
532
|
* sees `binary` first. */
|
|
400
533
|
export declare const WS_SUBPROTOCOL_CHOICES: readonly ["binary", "telnet", "telnet.mudstandards.org"];
|
|
@@ -410,6 +543,38 @@ export type BooleanProtocolKey = {
|
|
|
410
543
|
* more renderer options get exposed. Keep all fields optional so the
|
|
411
544
|
* patcher can ship partial updates and unset fields fall through to the
|
|
412
545
|
* renderer's own createSettings() defaults. */
|
|
546
|
+
/** The code editor's display options — desktop Mudlet's Editor preference
|
|
547
|
+
* page. `showItemIds` is the tree's, the other four the code view's; all are
|
|
548
|
+
* optional and fall back to `EDITOR_OPTION_DEFAULTS`.
|
|
549
|
+
*
|
|
550
|
+
* They apply to every CodeMirror surface in the app, not just the script
|
|
551
|
+
* editor: the file browser's editor and its JSON viewer read the same
|
|
552
|
+
* settings, because they are the same editor opened on a different document. */
|
|
553
|
+
export interface EditorSettings {
|
|
554
|
+
/** "Autocomplete Lua functions in code editor". Default on. */
|
|
555
|
+
autocomplete?: boolean;
|
|
556
|
+
/** "Show Spaces/Tabs". Default off. */
|
|
557
|
+
showWhitespace?: boolean;
|
|
558
|
+
/** "Show Line/Paragraphs" — a visible mark where each line ends. Default
|
|
559
|
+
* off. Desktop's checkbox is named for "line and paragraph ends with
|
|
560
|
+
* visible marks" but currently only rules a separator under each row:
|
|
561
|
+
* `slot_changeShowLineFeedsAndParagraphs` sets edbee's `useLineSeparator`
|
|
562
|
+
* (dlgProfilePreferences.cpp:4073), which the method's own comment calls a
|
|
563
|
+
* stand-in for the marks it was named for. Mudlet Web draws the marks. */
|
|
564
|
+
showLineParagraphs?: boolean;
|
|
565
|
+
/** "Show invisible Unicode control characters". Default off. */
|
|
566
|
+
showControlChars?: boolean;
|
|
567
|
+
/** "Show Items' ID number" — the numeric id beside each script, alias,
|
|
568
|
+
* trigger and so on in the editor's tree. Default off. */
|
|
569
|
+
showItemIds?: boolean;
|
|
570
|
+
/** "Theme" — the code editor's palette. `'app'` (the default) follows the
|
|
571
|
+
* app theme, as it always did; the other two pin it, and pinning covers
|
|
572
|
+
* the editor's chrome as well as its syntax colours, so a light editor is
|
|
573
|
+
* light-backgrounded even under a dark app theme. Typed as a plain string
|
|
574
|
+
* here so the schema does not depend on the CodeMirror layer;
|
|
575
|
+
* `EDITOR_THEME_CHOICES` is the authority on the values. */
|
|
576
|
+
theme?: 'app' | 'dark' | 'light';
|
|
577
|
+
}
|
|
413
578
|
export interface MapperSettings {
|
|
414
579
|
/** renderer.settings.roomSize — diameter/side of a room in map units. */
|
|
415
580
|
roomSize?: number;
|
|
@@ -432,6 +597,27 @@ export interface MapperSettings {
|
|
|
432
597
|
showDefaultArea?: boolean;
|
|
433
598
|
/** renderer.settings.gridEnabled — background grid overlay. */
|
|
434
599
|
gridEnabled?: boolean;
|
|
600
|
+
/** Mudlet's "Grid color" (Mapper colors page). Unset uses the renderer's
|
|
601
|
+
* own default. */
|
|
602
|
+
gridColor?: string;
|
|
603
|
+
/** Mudlet's "Grid width" (`mMapGridLineSize`): how *thick* the grid lines
|
|
604
|
+
* are, in map units — not how far apart they sit. The renderer calls that
|
|
605
|
+
* `gridLineWidth`; its `gridSize` is the spacing and has no Mudlet
|
|
606
|
+
* counterpart. Unset uses the renderer's own default. */
|
|
607
|
+
gridLineWidth?: number;
|
|
608
|
+
/** Mudlet's "2D Map Room Symbol Font" (`mMapSymbolFont`) — the font room
|
|
609
|
+
* symbols and the area-name header are drawn in. The bundled Bitstream Vera
|
|
610
|
+
* Sans Mono stays behind it as the fallback; unset uses that bundled font,
|
|
611
|
+
* which is Mudlet's default too.
|
|
612
|
+
*
|
|
613
|
+
* The same {@link OutputFontSource} the main display's font uses, so a
|
|
614
|
+
* symbol font can be installed, fetched from a URL or read out of the
|
|
615
|
+
* profile's own files — which matters more here than for body text: room
|
|
616
|
+
* symbols are picked for their *glyphs*, and the font that has the glyph a
|
|
617
|
+
* map wants is often one the machine does not have. A bare string is the
|
|
618
|
+
* older shape (a family name, nothing to load) and is still read; see
|
|
619
|
+
* {@link symbolFontSource}. */
|
|
620
|
+
symbolFont?: string | OutputFontSource;
|
|
435
621
|
/** renderer.settings.lodEnabled — level-of-detail for very dense planes.
|
|
436
622
|
* Above {@link lodExitBudget} rooms on the drawn (area, z-level) the
|
|
437
623
|
* renderer drops exit lines, and above {@link lodRoomBudget} it replaces
|
|
@@ -495,6 +681,16 @@ export interface PlayerMarkerSettings {
|
|
|
495
681
|
* that the user has actually set, so the renderer's own defaults stay in
|
|
496
682
|
* charge for anything untouched. */
|
|
497
683
|
export declare const PLAYER_MARKER_DEFAULTS: Required<PlayerMarkerSettings>;
|
|
684
|
+
/**
|
|
685
|
+
* A mapper symbol font in its current shape, whatever shape it was stored in.
|
|
686
|
+
*
|
|
687
|
+
* The field started life as a family name and became an {@link OutputFontSource}
|
|
688
|
+
* so the same picker (and the same URL/profile-file loading) could serve it. A
|
|
689
|
+
* profile written by an older build still holds the string, in localStorage and
|
|
690
|
+
* in its VFS `profile.json` both, so it is normalised on read rather than
|
|
691
|
+
* migrated: a family name is exactly a `system` source with nothing to load.
|
|
692
|
+
*/
|
|
693
|
+
export declare function symbolFontSource(font: string | OutputFontSource | undefined): OutputFontSource | undefined;
|
|
498
694
|
export declare const MAPPER_DEFAULTS: Required<MapperSettings>;
|
|
499
695
|
/** RGBA channels (0..255) for the map-info widget background. Stored in the
|
|
500
696
|
* profile `config` bag under `mapInfoColor` (Mudlet's `setConfig` key) and
|
|
@@ -507,6 +703,15 @@ export interface MapInfoBgColor {
|
|
|
507
703
|
}
|
|
508
704
|
/** Mudlet's default `mapInfoColor` (mMapInfoBg) — translucent grey. */
|
|
509
705
|
export declare const MAP_INFO_BG_DEFAULT: MapInfoBgColor;
|
|
706
|
+
/** Engines offered by the console's "Search on …" entry, mirroring Mudlet's
|
|
707
|
+
* `Host::mSearchEngineData` (`src/Host.cpp`). Each value is the prefix the
|
|
708
|
+
* percent-encoded selection is appended to. */
|
|
709
|
+
export declare const SEARCH_ENGINES: Record<string, string>;
|
|
710
|
+
/** What an unset or unrecognised `searchEngine` resolves to, as in Mudlet's
|
|
711
|
+
* `Host::getSearchEngine`. */
|
|
712
|
+
export declare const DEFAULT_SEARCH_ENGINE = "Google";
|
|
713
|
+
/** The stored engine name when we know it, else {@link DEFAULT_SEARCH_ENGINE}. */
|
|
714
|
+
export declare function resolveSearchEngine(name: string | undefined): string;
|
|
510
715
|
/** Defaults for profile settings. Reads fall through to these whenever a
|
|
511
716
|
* profile hasn't set the field. */
|
|
512
717
|
export declare const PROFILE_DEFAULTS: ProfileSettings;
|
|
@@ -553,7 +758,7 @@ export interface PackageManifest {
|
|
|
553
758
|
* This is what `getPackageInfo`/`getModuleInfo` answer with, so it has to
|
|
554
759
|
* stay the package author's own set: Mudlet reports what the manifest said
|
|
555
760
|
* and nothing more, which means a package that shipped no config.lua has no
|
|
556
|
-
* info at all rather than a table of things
|
|
761
|
+
* info at all rather than a table of things Mudlet Web worked out for itself
|
|
557
762
|
* (the derived name, the install timestamp). Absent when there was no
|
|
558
763
|
* config.lua to read.
|
|
559
764
|
*/
|
|
@@ -606,6 +811,11 @@ export interface TriggerPattern {
|
|
|
606
811
|
text: string;
|
|
607
812
|
type: TriggerPatternType;
|
|
608
813
|
}
|
|
814
|
+
/** Widest line delta a multiline (AND) trigger can ask for. Mudlet's control is
|
|
815
|
+
* a plain QSpinBox with no maximum set (`ui/triggers_main_area.ui`,
|
|
816
|
+
* spinBox_lineMargin), so Qt's default 99 is the ceiling a profile written
|
|
817
|
+
* there can carry — matching it keeps our XML readable by desktop Mudlet. */
|
|
818
|
+
export declare const MAX_CONDITION_LINE_DELTA = 99;
|
|
609
819
|
export interface TriggerNode extends BaseNode {
|
|
610
820
|
patterns: TriggerPattern[];
|
|
611
821
|
code: string;
|
|
@@ -616,23 +826,59 @@ export interface TriggerNode extends BaseNode {
|
|
|
616
826
|
delta: number;
|
|
617
827
|
isFilter: boolean;
|
|
618
828
|
/**
|
|
619
|
-
* Session-scoped:
|
|
620
|
-
*
|
|
621
|
-
*
|
|
622
|
-
*
|
|
623
|
-
*
|
|
829
|
+
* Session-scoped: an `isTempTrigger="yes"` trigger from a package or
|
|
830
|
+
* profile XML, which desktop loads as a temporary TTrigger in the tree.
|
|
831
|
+
* (Script-created temporary triggers, tempComplexRegexTrigger's included,
|
|
832
|
+
* never reach the store: they live in the trigger engine — see
|
|
833
|
+
* TEMP_PARENT_PREFIX.) killTrigger can remove it.
|
|
624
834
|
*
|
|
625
|
-
* Not persisted (see
|
|
626
|
-
* under it:
|
|
627
|
-
* parent does, so saving it would restore a child pointing at a parent that
|
|
628
|
-
* no longer exists.
|
|
835
|
+
* Not persisted (see persistableNodes), and neither is anything hanging
|
|
836
|
+
* under it: desktop's XMLexport skips a temporary root's whole subtree.
|
|
629
837
|
*/
|
|
630
838
|
temporary?: boolean;
|
|
839
|
+
/**
|
|
840
|
+
* Mudlet TTrigger::mIsColorizerTrigger — the master switch for `highlight`.
|
|
841
|
+
* The colours below persist independently of it (desktop defaults them to
|
|
842
|
+
* red/yellow and writes them whatever the switch says), so turning
|
|
843
|
+
* colorization off and back on keeps them. Read it through `isColorizing`,
|
|
844
|
+
* never directly: profiles written before this field existed carry only
|
|
845
|
+
* `highlight`, and a highlight there meant the switch was on.
|
|
846
|
+
*/
|
|
847
|
+
colorize?: boolean;
|
|
631
848
|
highlight?: {
|
|
632
849
|
fg?: string;
|
|
633
850
|
bg?: string;
|
|
634
851
|
};
|
|
635
852
|
command?: string;
|
|
853
|
+
/**
|
|
854
|
+
* Mudlet TTrigger::mTriggerType (TTrigger.h:204) — one of the REGEX_* kinds
|
|
855
|
+
* defined at TTrigger.h:49-56, the same numbering `patterns[].type` uses.
|
|
856
|
+
* It is a *node*-level kind that desktop keeps beside the per-pattern kinds
|
|
857
|
+
* in `regexCodePropertyList`, and does nothing with beyond storing it: the
|
|
858
|
+
* only readers are the XML reader (XMLimport.cpp:1379), the XML writer
|
|
859
|
+
* (XMLexport.cpp:1017) and the editor's copy/paste helper
|
|
860
|
+
* (EditorItemXMLHelpers.cpp:316). Kept as the raw integer so a value we do
|
|
861
|
+
* not recognise still survives a linked-profile write-back unchanged.
|
|
862
|
+
*/
|
|
863
|
+
triggerType?: number;
|
|
864
|
+
/**
|
|
865
|
+
* TTrigger::mSoundTrigger (TTrigger.h:149) — play `soundFile` on every fire,
|
|
866
|
+
* before the command and the script (TTrigger.cpp:1320-1330).
|
|
867
|
+
*/
|
|
868
|
+
soundTrigger?: boolean;
|
|
869
|
+
/** TTrigger::mSoundFile (TTrigger.h) — the file `soundTrigger` plays. */
|
|
870
|
+
soundFile?: string;
|
|
871
|
+
/**
|
|
872
|
+
* TTrigger::mColorTrigger (TTrigger.h:152) and its two colours
|
|
873
|
+
* (mColorTriggerFgColor / mColorTriggerBgColor). This is desktop's *legacy*
|
|
874
|
+
* per-node colour trigger, set by dlgColorTrigger, and distinct from the
|
|
875
|
+
* per-pattern `colorTrigger` kind this client actually matches on. Nothing
|
|
876
|
+
* here drives matching; the fields exist so a profile that carries them
|
|
877
|
+
* survives the round trip instead of being blanked on write-back.
|
|
878
|
+
*/
|
|
879
|
+
colorTrigger?: boolean;
|
|
880
|
+
colorTriggerFgColor?: string;
|
|
881
|
+
colorTriggerBgColor?: string;
|
|
636
882
|
}
|
|
637
883
|
export interface TimerNode extends BaseNode {
|
|
638
884
|
seconds: number;
|
|
@@ -640,26 +886,70 @@ export interface TimerNode extends BaseNode {
|
|
|
640
886
|
language: 'lua' | 'js';
|
|
641
887
|
repeat: boolean;
|
|
642
888
|
command?: string;
|
|
889
|
+
/**
|
|
890
|
+
* Session-scoped: an `isTempTimer="yes"` timer from a package or profile
|
|
891
|
+
* XML. Desktop loads it as a TTimer with mIsTempTimer set, so it fires once
|
|
892
|
+
* — its script only, never its command — and is then deleted, the way a
|
|
893
|
+
* `tempTimer` is. Not persisted (see persistableNodes), and neither is
|
|
894
|
+
* anything hanging under it.
|
|
895
|
+
*/
|
|
896
|
+
temporary?: boolean;
|
|
643
897
|
}
|
|
644
898
|
export interface KeyNode extends BaseNode {
|
|
645
899
|
key: string;
|
|
646
900
|
modifiers: string[];
|
|
901
|
+
/** The Qt::Key the binding was made with (permKey, desktop XML, the key
|
|
902
|
+
* recorder), when known. `key` alone is lossy — `!` and `1` are both
|
|
903
|
+
* Digit1 — and desktop matches on this, so a Key_Exclam binding without
|
|
904
|
+
* Shift never fires for a plain 1. getKeyCode and XML export report it. */
|
|
905
|
+
qtKey?: number;
|
|
647
906
|
code: string;
|
|
648
907
|
language: 'lua' | 'js';
|
|
649
908
|
command?: string;
|
|
650
909
|
}
|
|
651
910
|
export type ButtonLocation = 'top' | 'bottom' | 'left' | 'right' | 'floating';
|
|
652
911
|
export type ButtonOrientation = 'horizontal' | 'vertical';
|
|
912
|
+
/**
|
|
913
|
+
* Mudlet `TAction::mButtonRotation` — the index of `comboBox_action_button_rotation`
|
|
914
|
+
* (ui/actions_main_area.ui:272), stored as that integer in `<buttonRotation>`.
|
|
915
|
+
*
|
|
916
|
+
* 0 = upright; 1 turns the control clockwise, so its text reads downwards; 2
|
|
917
|
+
* turns it anticlockwise, reading upwards. The combo box labels those "90°
|
|
918
|
+
* rotation to the left" and "…to the right", which is the opposite way round
|
|
919
|
+
* from the turn they produce — the direction below is what desktop actually
|
|
920
|
+
* paints (`TFlipButton::paintEvent`: `rotate(90)` for index 1 and `rotate(-90)`
|
|
921
|
+
* for index 2, clockwise-positive in Qt's y-down space), so match that and
|
|
922
|
+
* leave the labels alone.
|
|
923
|
+
*/
|
|
924
|
+
export type ButtonRotation = 0 | 1 | 2;
|
|
925
|
+
/** Coerce an arbitrary `<buttonRotation>` integer to one of the three the combo
|
|
926
|
+
* box offers; anything else means upright, as `qMax(0, currentIndex())` does. */
|
|
927
|
+
export declare function asButtonRotation(n: number): ButtonRotation;
|
|
928
|
+
/**
|
|
929
|
+
* Clamp a toolbar's filler offset to what its grid can hold: Mudlet allows up to
|
|
930
|
+
* one less than the row/column count, and disables the control entirely below 2
|
|
931
|
+
* of them — a filler as wide as the grid would push every button off it (Mudlet
|
|
932
|
+
* #9332). Applied both on save and at render, so a profile written elsewhere
|
|
933
|
+
* cannot lay out differently from one written here.
|
|
934
|
+
*/
|
|
935
|
+
export declare function clampFillerOffset(offset: number, columns: number): number;
|
|
653
936
|
/**
|
|
654
937
|
* Mudlet-style action node. Groups are toolbars; leaves are buttons.
|
|
655
938
|
* Mirrors Mudlet's TAction (mLocation/mOrientation/mPushDownButton/...).
|
|
656
|
-
* `styleSheet` is persisted but not applied yet (no stylesheet support).
|
|
657
939
|
*/
|
|
658
940
|
export interface ButtonNode extends BaseNode {
|
|
659
941
|
orientation: ButtonOrientation;
|
|
660
942
|
location: ButtonLocation;
|
|
661
943
|
/** Number of columns for the toolbar grid. 0 = auto / single line (Mudlet TToolBar.mButtonColumns). */
|
|
662
944
|
columns: number;
|
|
945
|
+
/**
|
|
946
|
+
* Blank cells held before the first button — Mudlet's filler widget, sized
|
|
947
|
+
* by `TAction::mButtonFillerOffset` (`<buttonFillerOffset>`; spinBox_action_bar_
|
|
948
|
+
* offsetToFirstButton). Spans that many cells along the wrapping axis at
|
|
949
|
+
* (0, 0), so 0 (or a toolbar under 2 rows/columns, where desktop disables
|
|
950
|
+
* the control) means no filler at all.
|
|
951
|
+
*/
|
|
952
|
+
fillerOffset?: number;
|
|
663
953
|
/** Floating-toolbar geometry (groups with location='floating'). */
|
|
664
954
|
posX?: number;
|
|
665
955
|
posY?: number;
|
|
@@ -672,6 +962,8 @@ export interface ButtonNode extends BaseNode {
|
|
|
672
962
|
/** Path to icon image, relative to the profile VFS root (typically inside a package dir). */
|
|
673
963
|
icon?: string;
|
|
674
964
|
tooltip?: string;
|
|
965
|
+
/** Quarter-turn applied to the button's label. See {@link ButtonRotation}. */
|
|
966
|
+
rotation?: ButtonRotation;
|
|
675
967
|
/** Lua code; runs on every click regardless of state direction (Mudlet TAction.mScript). */
|
|
676
968
|
code: string;
|
|
677
969
|
language: 'lua' | 'js';
|
|
@@ -679,15 +971,78 @@ export interface ButtonNode extends BaseNode {
|
|
|
679
971
|
command?: string;
|
|
680
972
|
/** Command sent only when a two-state button goes DOWN (Mudlet commandButtonDown). */
|
|
681
973
|
commandDown?: string;
|
|
682
|
-
/**
|
|
974
|
+
/**
|
|
975
|
+
* Mudlet stylesheet text (`<css>`), applied to the button or the toolbar it
|
|
976
|
+
* is on. Only the flat-declaration subset survives the Qt→CSS conversion —
|
|
977
|
+
* pseudo-state selectors (`:hover`, `:pressed`) are dropped.
|
|
978
|
+
*/
|
|
683
979
|
styleSheet?: string;
|
|
684
980
|
}
|
|
981
|
+
/**
|
|
982
|
+
* Whether a trigger colorizes the text it matched. `colorize` is authoritative;
|
|
983
|
+
* a trigger from a profile saved before that field existed falls back to the old
|
|
984
|
+
* rule, where a highlight's presence was itself the switch.
|
|
985
|
+
*/
|
|
986
|
+
export declare function isColorizing(t: Pick<TriggerNode, 'colorize' | 'highlight'>): boolean;
|
|
987
|
+
/**
|
|
988
|
+
* The items that belong in a save: everything except the session-scoped
|
|
989
|
+
* (`temporary`) ones, and anything hanging under them.
|
|
990
|
+
*
|
|
991
|
+
* The descendants matter as much as the temporaries themselves. A permanent
|
|
992
|
+
* item can be parented to a temporary one — Mudlet allows it, and its own
|
|
993
|
+
* specs do it — and that child dies with its parent at the end of the session.
|
|
994
|
+
* Saving it alone would restore an item whose `parentId` names a node that
|
|
995
|
+
* was never written, leaving it orphaned in the tree. Desktop's XMLexport
|
|
996
|
+
* skips a temporary item the same way, subtree and all.
|
|
997
|
+
*/
|
|
998
|
+
export declare function persistableNodes<T extends {
|
|
999
|
+
id: string;
|
|
1000
|
+
parentId: string | null;
|
|
1001
|
+
temporary?: boolean;
|
|
1002
|
+
}>(items: T[]): T[];
|
|
1003
|
+
/** Prefix of a `parentId` that names a temporary item rather than a node. */
|
|
1004
|
+
export declare const TEMP_PARENT_PREFIX = "temp:";
|
|
1005
|
+
/** The `parentId` a permanent child of temporary item `id` carries. */
|
|
1006
|
+
export declare function tempParentRef(id: number): string;
|
|
1007
|
+
/** Whether `parentId` names a temporary item (see TEMP_PARENT_PREFIX). */
|
|
1008
|
+
export declare function isTempParentRef(parentId: string | null | undefined): parentId is string;
|
|
1009
|
+
/** The temporary item's id a temp parent ref names, or null for anything else. */
|
|
1010
|
+
export declare function tempRefId(parentId: string | null | undefined): number | null;
|
|
1011
|
+
/**
|
|
1012
|
+
* The temporary item a node ultimately hangs off, or null when its whole
|
|
1013
|
+
* ancestry is in the store. Temporary items are always roots (no temp* API
|
|
1014
|
+
* takes a parent), so this is the top store ancestor's parent ref.
|
|
1015
|
+
*/
|
|
1016
|
+
export declare function tempRootOf<T extends {
|
|
1017
|
+
id: string;
|
|
1018
|
+
parentId: string | null;
|
|
1019
|
+
}>(node: T, byId: ReadonlyMap<string, T>): number | null;
|
|
1020
|
+
/** The nodes the script editor shows: everything but the permanent items that
|
|
1021
|
+
* hang off a temporary one, which desktop's editor drops along with their
|
|
1022
|
+
* parent's subtree whenever it saves (see TEMP_PARENT_PREFIX). */
|
|
1023
|
+
export declare function visibleTreeNodes<T extends {
|
|
1024
|
+
id: string;
|
|
1025
|
+
parentId: string | null;
|
|
1026
|
+
}>(items: T[]): T[];
|
|
685
1027
|
/** Returns true if the item and all its ancestors are enabled. */
|
|
686
1028
|
export declare function isEffectivelyEnabled<T extends {
|
|
687
1029
|
id: string;
|
|
688
1030
|
enabled: boolean;
|
|
689
1031
|
parentId: string | null;
|
|
690
1032
|
}>(item: T, allItems: T[]): boolean;
|
|
1033
|
+
/**
|
|
1034
|
+
* The items in tree order: Mudlet's pre-order walk, each node immediately
|
|
1035
|
+
* followed by its whole subtree, siblings in the order the flat array holds
|
|
1036
|
+
* them. The flat array alone is not that order — an item added to an older
|
|
1037
|
+
* group (`permAlias`/`permKey` into a group made earlier) is appended at the
|
|
1038
|
+
* end, after root items created since, while desktop puts it inside its group.
|
|
1039
|
+
* An item whose parent is missing is walked as a root where it stands; a
|
|
1040
|
+
* malformed cycle is broken rather than dropped.
|
|
1041
|
+
*/
|
|
1042
|
+
export declare function inTreeOrder<T extends {
|
|
1043
|
+
id: string;
|
|
1044
|
+
parentId: string | null;
|
|
1045
|
+
}>(items: readonly T[]): T[];
|
|
691
1046
|
/**
|
|
692
1047
|
* One-pass build of the set of ids whose item and every ancestor is enabled.
|
|
693
1048
|
* Engines iterating large trees should call this once per loadPerm rather than
|
|
@@ -698,7 +1053,11 @@ export declare function buildEffectivelyEnabledIds<T extends {
|
|
|
698
1053
|
id: string;
|
|
699
1054
|
enabled: boolean;
|
|
700
1055
|
parentId: string | null;
|
|
701
|
-
}>(items: T[]
|
|
1056
|
+
}>(items: T[],
|
|
1057
|
+
/** Ids that cannot be active whatever their switch says — Mudlet's items
|
|
1058
|
+
* whose code or pattern failed to compile (`Tree::state()` false). They
|
|
1059
|
+
* count as switched off, so their descendants are left out too. */
|
|
1060
|
+
blocked?: ReadonlySet<string>): Set<string>;
|
|
702
1061
|
export interface ModalBounds {
|
|
703
1062
|
x: number;
|
|
704
1063
|
y: number;
|
|
@@ -729,6 +1088,17 @@ export interface ScriptEditorBounds extends ModalBounds {
|
|
|
729
1088
|
export interface ProfileVariables {
|
|
730
1089
|
saveList: string[];
|
|
731
1090
|
values: MudletVariable[];
|
|
1091
|
+
/**
|
|
1092
|
+
* Variables the user has hidden from the Variables view (Mudlet's
|
|
1093
|
+
* `VarUnit::mHiddenVariables`, written as `<HiddenVariables>`). Optional so
|
|
1094
|
+
* a profile saved before this existed still parses.
|
|
1095
|
+
*
|
|
1096
|
+
* Entries are the path as Lua reads it — `myTable.sub`, `myTable[3]` — so a
|
|
1097
|
+
* nested key can be hidden too. Mudlet has only ever been observed writing
|
|
1098
|
+
* this block empty, so its nested spelling is unverified; a path it does not
|
|
1099
|
+
* recognise simply shows the variable there rather than hiding it.
|
|
1100
|
+
*/
|
|
1101
|
+
hidden?: string[];
|
|
732
1102
|
}
|
|
733
1103
|
export interface AppSchema {
|
|
734
1104
|
connections: MudConnection[];
|
|
@@ -769,6 +1139,17 @@ export declare const APP_DEFAULTS: AppSchema;
|
|
|
769
1139
|
* `useAppStore(s => selectProfileField(s, id, 'fontSize'))`.
|
|
770
1140
|
*/
|
|
771
1141
|
export declare function selectProfileField<K extends keyof ProfileSettings>(s: Pick<AppSchema, 'connectionProfile'>, connectionId: string | null, key: K): ProfileSettings[K];
|
|
1142
|
+
/**
|
|
1143
|
+
* Append the dial parameters to a proxy base URL.
|
|
1144
|
+
*
|
|
1145
|
+
* Built with `URL`/`URLSearchParams` rather than string concatenation, which
|
|
1146
|
+
* emitted a second `?` for a base that already carried a query — breaking any
|
|
1147
|
+
* self-hosted proxy protected by a token in its query string, the natural way
|
|
1148
|
+
* to protect one (issue #56). A base we cannot parse is concatenated as before
|
|
1149
|
+
* rather than dropped: a profile that somehow holds one should still dial the
|
|
1150
|
+
* thing it used to.
|
|
1151
|
+
*/
|
|
1152
|
+
export declare function withProxyParams(base: string, params: [string, string][]): string;
|
|
772
1153
|
export declare function connectionUrl(c: MudConnection, userProxyUrl?: string): string;
|
|
773
1154
|
/** The proxy a `mud`-mode connection will actually dial, applying the same
|
|
774
1155
|
* precedence as {@link connectionUrl}: per-connection > user's own > brand >
|
|
@@ -783,20 +1164,15 @@ export declare function effectiveProxyUrl(c: MudConnection, userProxyUrl?: strin
|
|
|
783
1164
|
* no certificate and no way to waive a validation failure — the options would be
|
|
784
1165
|
* silently ignored, so the UI disables them instead of pretending.
|
|
785
1166
|
*
|
|
786
|
-
* Recognised by the `workers.dev` hostname, which covers
|
|
787
|
-
*
|
|
788
|
-
*
|
|
789
|
-
*
|
|
1167
|
+
* Recognised by the `workers.dev` hostname, which covers anything deployed
|
|
1168
|
+
* from `worker/` under its own subdomain — plus the built-in default, which is
|
|
1169
|
+
* a Worker on a custom domain and so cannot be recognised by its name at all.
|
|
1170
|
+
* Any other Worker on a custom domain can't be told apart from a Node proxy up
|
|
1171
|
+
* front; that case is corrected at runtime by the `certInspection: false` flag
|
|
1172
|
+
* the proxy reports on `tls.established`.
|
|
790
1173
|
*/
|
|
791
1174
|
export declare function proxyCanInspectCertificates(proxyUrl: string): boolean;
|
|
792
1175
|
export declare function connectionDisplayAddr(c: MudConnection): string;
|
|
793
|
-
/** Whether the connection's link to the *game server* is TLS-encrypted — the
|
|
794
|
-
* signal reported as the NEW-ENVIRON `TLS` variable. In `websocket` mode the
|
|
795
|
-
* browser connects straight to the game, so a `wss://` URL is end-to-end TLS.
|
|
796
|
-
* In `mud` (proxy) mode the browser↔proxy hop being `wss://` says nothing about
|
|
797
|
-
* the proxy↔game hop: that leg is a plaintext telnet socket unless `tls` is set,
|
|
798
|
-
* which makes the proxy perform a TLS handshake with the game instead. */
|
|
799
|
-
export declare function connectionSecureTransport(c: MudConnection): boolean;
|
|
800
1176
|
/**
|
|
801
1177
|
* Whether `name` is already some other profile's, ignoring case.
|
|
802
1178
|
*
|
|
@@ -810,6 +1186,102 @@ export declare function connectionSecureTransport(c: MudConnection): boolean;
|
|
|
810
1186
|
* not a clash.
|
|
811
1187
|
*/
|
|
812
1188
|
export declare function connectionNameTaken(name: string, connections: MudConnection[], exceptId?: string): boolean;
|
|
1189
|
+
/** The port a `mud`-mode connection falls back to when none was typed — the
|
|
1190
|
+
* Port field's placeholder, and the telnet default both proxies assume. */
|
|
1191
|
+
export declare const DEFAULT_MUD_PORT = 23;
|
|
1192
|
+
export type PortValidation = {
|
|
1193
|
+
ok: true;
|
|
1194
|
+
port: number;
|
|
1195
|
+
} | {
|
|
1196
|
+
ok: false;
|
|
1197
|
+
reason: 'notANumber' | 'outOfRange';
|
|
1198
|
+
message: string;
|
|
1199
|
+
};
|
|
1200
|
+
/**
|
|
1201
|
+
* Validate what the user typed into a Port field.
|
|
1202
|
+
*
|
|
1203
|
+
* `parseInt` is not a validator: it stops at the first character it doesn't
|
|
1204
|
+
* understand and returns what it read so far, so `1e3` becomes 1, `0x50`
|
|
1205
|
+
* becomes 0 and `23abc` becomes 23 — a *different* port from the one typed,
|
|
1206
|
+
* saved without a word. So the text is matched against `^\d+$` first, exactly
|
|
1207
|
+
* as Mudlet does (`src/dlgConnectionProfiles.cpp:2140-2160`), and only then
|
|
1208
|
+
* range-checked. The two messages are Mudlet's, verbatim.
|
|
1209
|
+
*
|
|
1210
|
+
* The range is the one both proxies already enforce server-side
|
|
1211
|
+
* (`proxy/server.ts`, `worker/index.js`) — where the rejection reason never
|
|
1212
|
+
* reaches the user, who is instead told the proxy is unreachable.
|
|
1213
|
+
*
|
|
1214
|
+
* An empty field is accepted as {@link DEFAULT_MUD_PORT}: it is what the
|
|
1215
|
+
* placeholder promises, and Mudlet's validator likewise skips an empty port.
|
|
1216
|
+
*/
|
|
1217
|
+
export declare function validatePort(text: string): PortValidation;
|
|
1218
|
+
export type HostValidation = {
|
|
1219
|
+
ok: true;
|
|
1220
|
+
host: string;
|
|
1221
|
+
} | {
|
|
1222
|
+
ok: false;
|
|
1223
|
+
reason: 'empty' | 'malformed' | 'tooLong' | 'rawIpWithTls';
|
|
1224
|
+
message: string;
|
|
1225
|
+
};
|
|
1226
|
+
/**
|
|
1227
|
+
* Validate what the user typed into the Host field of a `mud`-mode profile.
|
|
1228
|
+
*
|
|
1229
|
+
* Nothing used to: `my host with spaces`, `ws://achaea.com`, `achaea.com/path`
|
|
1230
|
+
* and a 1200-character string were all accepted and stored verbatim, and only
|
|
1231
|
+
* failed much later as the proxy's generic connect error (issue #56). Mudlet
|
|
1232
|
+
* refuses them at the dialog, and refuses a raw IP when TLS is ticked because a
|
|
1233
|
+
* certificate cannot name one — both messages below are Mudlet's.
|
|
1234
|
+
*
|
|
1235
|
+
* `tls` is the profile's TLS switch; the raw-IP rule only applies with it on.
|
|
1236
|
+
*/
|
|
1237
|
+
export declare function validateHost(text: string, tls?: boolean): HostValidation;
|
|
1238
|
+
export type UrlValidation = {
|
|
1239
|
+
ok: true;
|
|
1240
|
+
url: string;
|
|
1241
|
+
insecure: boolean;
|
|
1242
|
+
} | {
|
|
1243
|
+
ok: false;
|
|
1244
|
+
reason: 'empty' | 'malformed' | 'wrongScheme';
|
|
1245
|
+
message: string;
|
|
1246
|
+
};
|
|
1247
|
+
/**
|
|
1248
|
+
* Validate the URL of a `websocket`-mode profile.
|
|
1249
|
+
*
|
|
1250
|
+
* `http://example.com`, `not a url` and `javascript:alert(1)` all used to save
|
|
1251
|
+
* without complaint, and the `ws://`-on-`https://` case only surfaced on
|
|
1252
|
+
* Connect as the browser's own "An insecure WebSocket connection may not be
|
|
1253
|
+
* initiated from a page loaded over HTTPS." The scheme is decidable here, so it
|
|
1254
|
+
* is decided here.
|
|
1255
|
+
*
|
|
1256
|
+
* `insecure` reports the one case that is well-formed but cannot work from this
|
|
1257
|
+
* page — `ws://` served over `https://` — so the caller can warn rather than
|
|
1258
|
+
* refuse: it is correct on an `http://` dev server, and the page's own scheme
|
|
1259
|
+
* is not the URL's fault.
|
|
1260
|
+
*/
|
|
1261
|
+
export declare function validateWsUrl(text: string, pageProtocol?: string): UrlValidation;
|
|
1262
|
+
export type ProxyValidation = {
|
|
1263
|
+
ok: true;
|
|
1264
|
+
url: string;
|
|
1265
|
+
insecure: boolean;
|
|
1266
|
+
} | {
|
|
1267
|
+
ok: false;
|
|
1268
|
+
reason: 'malformed' | 'relative' | 'wrongScheme' | 'hasQuery';
|
|
1269
|
+
message: string;
|
|
1270
|
+
};
|
|
1271
|
+
/**
|
|
1272
|
+
* Validate the per-profile proxy override. Empty is valid — it means "use the
|
|
1273
|
+
* default".
|
|
1274
|
+
*
|
|
1275
|
+
* Three things used to go wrong silently (issue #56): a bare `proxy.example`
|
|
1276
|
+
* resolved *relative to the page*, so the profile dialed
|
|
1277
|
+
* `https://mudlet-web.mudlet.org/proxy.example?host=…`; an `http://` override
|
|
1278
|
+
* could only ever fail as mixed content; and an override already carrying a
|
|
1279
|
+
* query string — the natural way to put a token on a self-hosted proxy — was
|
|
1280
|
+
* concatenated into a second `?`, which no server can parse. The query case is
|
|
1281
|
+
* now supported rather than rejected ({@link connectionUrl} merges parameters),
|
|
1282
|
+
* so it is only reported here when the URL is otherwise unusable.
|
|
1283
|
+
*/
|
|
1284
|
+
export declare function validateProxyUrl(text: string, pageProtocol?: string): ProxyValidation;
|
|
813
1285
|
/**
|
|
814
1286
|
* `name` if no other profile has it, otherwise the first free `name (2)`,
|
|
815
1287
|
* `name (3)`, … — the same shape Mudlet gives a profile copied over an existing
|