@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.
Files changed (301) hide show
  1. package/README.md +1 -1
  2. package/dist-lib/analytics.d.ts +27 -0
  3. package/dist-lib/assets/fonts/Vera.woff2 +0 -0
  4. package/dist-lib/assets/fonts/VeraBI.woff2 +0 -0
  5. package/dist-lib/assets/fonts/VeraBd.woff2 +0 -0
  6. package/dist-lib/assets/fonts/VeraIt.woff2 +0 -0
  7. package/dist-lib/assets/mapParser.worker-DrVZ3wg_.js +9 -0
  8. package/dist-lib/backupImport-wt8r7JXI.js +233 -0
  9. package/dist-lib/branding.d.ts +111 -13
  10. package/dist-lib/db/sqliteClient.d.ts +195 -7
  11. package/dist-lib/hooks/useAutoReconnect.d.ts +61 -0
  12. package/dist-lib/hooks/useDocumentFullscreen.d.ts +23 -0
  13. package/dist-lib/hooks/useKeyboardShortcuts.d.ts +37 -0
  14. package/dist-lib/hooks/useRecordLastPlayed.d.ts +10 -0
  15. package/dist-lib/import/applyMudletProfile.d.ts +35 -9
  16. package/dist-lib/import/backupImport.d.ts +118 -0
  17. package/dist-lib/import/collectProfileExport.d.ts +33 -2
  18. package/dist-lib/import/defaultPackages.d.ts +57 -14
  19. package/dist-lib/import/defaults/CF-loader/CF-loader.mpackage +0 -0
  20. package/dist-lib/import/defaults/MedBootstrap/MedBootstrap.mpackage +0 -0
  21. package/dist-lib/import/defaults/deleteOldProfiles/deleteOldProfiles.mpackage +0 -0
  22. package/dist-lib/import/defaults/echo/echo.mpackage +0 -0
  23. package/dist-lib/import/defaults/enable-accessibility/enable-accessibility.mpackage +0 -0
  24. package/dist-lib/import/defaults/generic_mapper/generic_mapper.mpackage +0 -0
  25. package/dist-lib/import/defaults/gui-drop/gui-drop.mpackage +0 -0
  26. package/dist-lib/import/defaults/icesus-loader/icesus-loader.mpackage +0 -0
  27. package/dist-lib/import/defaults/mg-loader/mg-loader.mpackage +0 -0
  28. package/dist-lib/import/defaults/mudlet-base-ui/mudlet-base-ui.mpackage +0 -0
  29. package/dist-lib/import/defaults/mudlet-mapper.xml +1215 -389
  30. package/dist-lib/import/mudletControlChars.d.ts +14 -0
  31. package/dist-lib/import/mudletHost.d.ts +73 -10
  32. package/dist-lib/import/mudletLink.d.ts +53 -2
  33. package/dist-lib/import/mudletProfileExport.d.ts +38 -5
  34. package/dist-lib/import/mudletProfileImport.d.ts +110 -12
  35. package/dist-lib/import/mudletVariables.d.ts +4 -3
  36. package/dist-lib/import/mudletWriteback.d.ts +15 -1
  37. package/dist-lib/import/mudletXmlImport.d.ts +46 -0
  38. package/dist-lib/import/packageFonts.d.ts +33 -0
  39. package/dist-lib/import/packageInstaller.d.ts +111 -7
  40. package/dist-lib/import/qtProfileData.d.ts +10 -0
  41. package/dist-lib/import/remotePackageInstall.d.ts +23 -7
  42. package/dist-lib/import/zipEntries.d.ts +45 -0
  43. package/dist-lib/index.d.ts +7 -3
  44. package/dist-lib/index.js +50508 -29836
  45. package/dist-lib/logging/SessionLogger.d.ts +75 -15
  46. package/dist-lib/map/MapSelectionOverlay.d.ts +2 -2
  47. package/dist-lib/map/MapStore.d.ts +387 -60
  48. package/dist-lib/map/MudletHighlightOverlay.d.ts +2 -2
  49. package/dist-lib/map/{MudixMapReader.d.ts → MudletMapReader.d.ts} +2 -2
  50. package/dist-lib/map/areaGraph.d.ts +120 -0
  51. package/dist-lib/map/environmentKit.d.ts +36 -0
  52. package/dist-lib/map/labelPixmap.d.ts +90 -0
  53. package/dist-lib/map/mapImageExport.d.ts +36 -2
  54. package/dist-lib/map/mapStyle.d.ts +11 -0
  55. package/dist-lib/map/mapVersion.d.ts +66 -0
  56. package/dist-lib/map/pathfinding.d.ts +2 -2
  57. package/dist-lib/mud/CharLoginController.d.ts +230 -0
  58. package/dist-lib/mud/ItemIdSequence.d.ts +1 -1
  59. package/dist-lib/mud/MudSession.d.ts +279 -22
  60. package/dist-lib/mud/PatternEngine.d.ts +153 -14
  61. package/dist-lib/mud/aliases/AliasEngine.d.ts +55 -9
  62. package/dist-lib/mud/autoLogin.d.ts +59 -0
  63. package/dist-lib/mud/commandSplit.d.ts +9 -0
  64. package/dist-lib/mud/connection/LineAssembler.d.ts +38 -11
  65. package/dist-lib/mud/connection/MudClient.d.ts +291 -53
  66. package/dist-lib/mud/connection/SubnegotiationRepair.d.ts +24 -0
  67. package/dist-lib/mud/connection/TelnetNegotiator.d.ts +208 -68
  68. package/dist-lib/mud/connection/telnetDebug.d.ts +8 -8
  69. package/dist-lib/mud/events.d.ts +102 -23
  70. package/dist-lib/mud/games/bundledGames.d.ts +12 -7
  71. package/dist-lib/mud/games/gameLinks.d.ts +40 -0
  72. package/dist-lib/mud/games/icons/3Kingdoms.png +0 -0
  73. package/dist-lib/mud/games/icons/3Scapes.png +0 -0
  74. package/dist-lib/mud/games/icons/achaea.png +0 -0
  75. package/dist-lib/mud/games/icons/aetolia.png +0 -0
  76. package/dist-lib/mud/games/icons/banner_astaria.png +0 -0
  77. package/dist-lib/mud/games/icons/banner_darkmists.png +0 -0
  78. package/dist-lib/mud/games/icons/banner_dreamland.png +0 -0
  79. package/dist-lib/mud/games/icons/banner_petria.jpg +0 -0
  80. package/dist-lib/mud/games/icons/banner_ropmud.png +0 -0
  81. package/dist-lib/mud/games/icons/blackmud.png +0 -0
  82. package/dist-lib/mud/games/icons/carrionfields.png +0 -0
  83. package/dist-lib/mud/games/icons/dragonfire_icon.png +0 -0
  84. package/dist-lib/mud/games/icons/fed2-logo.png +0 -0
  85. package/dist-lib/mud/games/icons/icesus_480x120.png +0 -0
  86. package/dist-lib/mud/games/icons/imperian.png +0 -0
  87. package/dist-lib/mud/games/icons/infinity_480x120.png +0 -0
  88. package/dist-lib/mud/games/icons/lusternia.png +0 -0
  89. package/dist-lib/mud/games/icons/morgengrauen_480x120.png +0 -0
  90. package/dist-lib/mud/games/icons/mudlet-tutorial.png +0 -0
  91. package/dist-lib/mud/games/icons/phoenixmud_480x120.png +0 -0
  92. package/dist-lib/mud/games/icons/starmourn.png +0 -0
  93. package/dist-lib/mud/games/icons/voidmud_icon.png +0 -0
  94. package/dist-lib/mud/games/icons/wotmudicon.png +0 -0
  95. package/dist-lib/mud/games/websiteLinks.d.ts +21 -0
  96. package/dist-lib/mud/keybindings/KeyEngine.d.ts +110 -4
  97. package/dist-lib/mud/keybindings/browserReservedKeys.d.ts +2 -2
  98. package/dist-lib/mud/keybindings/keyEventTarget.d.ts +61 -0
  99. package/dist-lib/mud/keybindings/qtKeys.d.ts +91 -12
  100. package/dist-lib/mud/protocol/atcp.d.ts +19 -0
  101. package/dist-lib/mud/protocol/byteString.d.ts +24 -0
  102. package/dist-lib/mud/protocol/charLoginFlow.d.ts +243 -16
  103. package/dist-lib/mud/protocol/charset.d.ts +111 -46
  104. package/dist-lib/mud/protocol/codePages.d.ts +10 -0
  105. package/dist-lib/mud/protocol/constants.d.ts +17 -10
  106. package/dist-lib/mud/protocol/echo.d.ts +23 -27
  107. package/dist-lib/mud/protocol/gmcp.d.ts +36 -6
  108. package/dist-lib/mud/protocol/index.d.ts +3 -2
  109. package/dist-lib/mud/protocol/luaLiteral.d.ts +12 -0
  110. package/dist-lib/mud/protocol/mccp.d.ts +83 -1
  111. package/dist-lib/mud/protocol/mnes.d.ts +41 -58
  112. package/dist-lib/mud/protocol/msdp.d.ts +11 -4
  113. package/dist-lib/mud/protocol/msp.d.ts +3 -2
  114. package/dist-lib/mud/protocol/mssp.d.ts +9 -4
  115. package/dist-lib/mud/protocol/multiByte.d.ts +51 -0
  116. package/dist-lib/mud/protocol/multiByteEncode.d.ts +42 -0
  117. package/dist-lib/mud/protocol/mxp.d.ts +193 -14
  118. package/dist-lib/mud/protocol/oauthClientFlow.d.ts +128 -0
  119. package/dist-lib/mud/protocol/qtCodePages.generated.d.ts +1 -0
  120. package/dist-lib/mud/protocol/tlsCodes.d.ts +40 -3
  121. package/dist-lib/mud/replay/ReplayPlayer.d.ts +16 -1
  122. package/dist-lib/mud/replay/replayFormat.d.ts +29 -2
  123. package/dist-lib/mud/text/Console.d.ts +255 -49
  124. package/dist-lib/mud/text/FormatState.d.ts +137 -14
  125. package/dist-lib/mud/text/ansiEscapes.d.ts +32 -16
  126. package/dist-lib/mud/text/colorParsers.d.ts +14 -2
  127. package/dist-lib/mud/text/colorSpaceId.d.ts +2 -0
  128. package/dist-lib/mud/text/colors.d.ts +17 -10
  129. package/dist-lib/mud/text/controlCharacterMode.d.ts +1 -1
  130. package/dist-lib/mud/text/hyperlinkVisibility.d.ts +1 -1
  131. package/dist-lib/mud/text/lineBreak.d.ts +5 -0
  132. package/dist-lib/mud/text/serverWrap.d.ts +2 -2
  133. package/dist-lib/mud/text/textAnalyzer.d.ts +79 -0
  134. package/dist-lib/mud/text/unicodeRuns.d.ts +11 -0
  135. package/dist-lib/mud/text/unicodeTables.generated.d.ts +3 -0
  136. package/dist-lib/mud/text/wcwidth.d.ts +27 -22
  137. package/dist-lib/mud/timers/TimerEngine.d.ts +163 -11
  138. package/dist-lib/mud/timers/workerClock.d.ts +67 -0
  139. package/dist-lib/mud/triggers/TriggerEngine.d.ts +449 -47
  140. package/dist-lib/mud/triggers/legacyColorPatterns.d.ts +58 -0
  141. package/dist-lib/mud/triggers/pcre/Pcre2.d.ts +83 -1
  142. package/dist-lib/oauth-callback.html +94 -0
  143. package/dist-lib/pcre2Wasm.d.ts +54 -0
  144. package/dist-lib/pcre2Wasm.js +241 -0
  145. package/dist-lib/scripting/EngineHost.d.ts +45 -21
  146. package/dist-lib/scripting/IScriptingRuntime.d.ts +103 -27
  147. package/dist-lib/scripting/MxpFrameManager.d.ts +10 -1
  148. package/dist-lib/scripting/ScriptingAPI.d.ts +1030 -213
  149. package/dist-lib/scripting/ScriptingEngine.d.ts +727 -106
  150. package/dist-lib/scripting/StopwatchManager.d.ts +97 -36
  151. package/dist-lib/scripting/http/HttpService.d.ts +9 -1
  152. package/dist-lib/scripting/http/userUrl.d.ts +41 -0
  153. package/dist-lib/scripting/lua/LuaRuntime.d.ts +352 -77
  154. package/dist-lib/scripting/lua/argContracts.d.ts +71 -0
  155. package/dist-lib/scripting/lua/bindings/automation.d.ts +1 -1
  156. package/dist-lib/scripting/lua/bindings/commands.d.ts +13 -0
  157. package/dist-lib/scripting/lua/bindings/context.d.ts +20 -2
  158. package/dist-lib/scripting/lua/bindings/diagnostics.d.ts +1 -1
  159. package/dist-lib/scripting/lua/bindings/map.d.ts +1 -1
  160. package/dist-lib/scripting/lua/bindings/media.d.ts +2 -2
  161. package/dist-lib/scripting/lua/bindings/output.d.ts +1 -1
  162. package/dist-lib/scripting/lua/bindings/session.d.ts +2 -2
  163. package/dist-lib/scripting/lua/bindings/textEdit.d.ts +1 -1
  164. package/dist-lib/scripting/lua/bindings/userWindows.d.ts +1 -1
  165. package/dist-lib/scripting/lua/byteArmor.d.ts +36 -0
  166. package/dist-lib/scripting/lua/imageSize.d.ts +7 -0
  167. package/dist-lib/scripting/lua/rex.d.ts +4 -2
  168. package/dist-lib/scripting/lua/sqlRowEncoder.d.ts +6 -1
  169. package/dist-lib/scripting/lua/utf8CaseMap.d.ts +1 -0
  170. package/dist-lib/scripting/lua/utf8Patterns.d.ts +21 -1
  171. package/dist-lib/scripting/lua/wellFormedStrings.d.ts +40 -0
  172. package/dist-lib/scripting/lua/yajl.d.ts +43 -5
  173. package/dist-lib/scripting/profilesPresence.d.ts +20 -2
  174. package/dist-lib/scripting/vfs/ProfileVFS.d.ts +164 -10
  175. package/dist-lib/scripting/vfs/fsErrors.d.ts +28 -0
  176. package/dist-lib/scripting/vfs/idbCommit.d.ts +20 -0
  177. package/dist-lib/storage/appStore.d.ts +24 -9
  178. package/dist-lib/storage/hooks.d.ts +5 -1
  179. package/dist-lib/storage/index.d.ts +2 -2
  180. package/dist-lib/storage/mapStorage.d.ts +2 -0
  181. package/dist-lib/storage/persistentStorage.d.ts +3 -1
  182. package/dist-lib/storage/profileStorage.d.ts +15 -0
  183. package/dist-lib/storage/profileVfsData.d.ts +3 -3
  184. package/dist-lib/storage/schema.d.ts +512 -40
  185. package/dist-lib/storage/storageMigration.d.ts +82 -0
  186. package/dist-lib/storage-g5V1b-c1.js +2039 -0
  187. package/dist-lib/styles.css +1 -1
  188. package/dist-lib/ui/AboutModal.d.ts +1 -1
  189. package/dist-lib/ui/BrandLoginFields.d.ts +1 -1
  190. package/dist-lib/ui/BrowserSignInModal.d.ts +23 -0
  191. package/dist-lib/ui/CmdLineMenuRegistry.d.ts +14 -5
  192. package/dist-lib/ui/CommandBar.d.ts +8 -8
  193. package/dist-lib/ui/ConnectionFormModal.d.ts +20 -1
  194. package/dist-lib/ui/ConnectionScreen.d.ts +9 -1
  195. package/dist-lib/ui/GameLinkPrompt.d.ts +28 -0
  196. package/dist-lib/ui/HelpModal.d.ts +5 -1
  197. package/dist-lib/ui/MapSymbolUsageModal.d.ts +32 -0
  198. package/dist-lib/ui/MouseEventRegistry.d.ts +31 -4
  199. package/dist-lib/ui/NotepadModal.d.ts +22 -0
  200. package/dist-lib/ui/ResizableModal.d.ts +16 -1
  201. package/dist-lib/ui/SettingsModal.d.ts +10 -1
  202. package/dist-lib/ui/TlsAlertBanner.d.ts +3 -1
  203. package/dist-lib/ui/Toolbar.d.ts +22 -1
  204. package/dist-lib/ui/VaultManageButton.d.ts +10 -5
  205. package/dist-lib/ui/VaultModal.d.ts +3 -0
  206. package/dist-lib/ui/buttons/ButtonsBar.d.ts +3 -1
  207. package/dist-lib/ui/buttons/inactiveButtons.d.ts +25 -0
  208. package/dist-lib/ui/cmdline/CommandLineManager.d.ts +19 -0
  209. package/dist-lib/ui/cmdline/plainText.d.ts +16 -0
  210. package/dist-lib/ui/cmdline/subCommandLine.d.ts +78 -0
  211. package/dist-lib/ui/cmdline/useCmdLineSelection.d.ts +26 -0
  212. package/dist-lib/ui/cmdline/useSubCommandLineKeys.d.ts +33 -0
  213. package/dist-lib/ui/codemirror/lineParagraphMarks.d.ts +19 -0
  214. package/dist-lib/ui/codemirror/luaHover.d.ts +7 -0
  215. package/dist-lib/ui/codemirror/options.d.ts +33 -0
  216. package/dist-lib/ui/codemirror/theme.d.ts +29 -5
  217. package/dist-lib/ui/commands/addonCommands.d.ts +134 -0
  218. package/dist-lib/ui/commands/appShortcuts.d.ts +86 -0
  219. package/dist-lib/ui/commands/hostCommands.d.ts +88 -0
  220. package/dist-lib/ui/commands/keyMatch.d.ts +20 -0
  221. package/dist-lib/ui/commands/keySequence.d.ts +57 -0
  222. package/dist-lib/ui/components/ContextMenu.d.ts +21 -1
  223. package/dist-lib/ui/components/FontPicker.d.ts +5 -1
  224. package/dist-lib/ui/components/useModalFocus.d.ts +13 -1
  225. package/dist-lib/ui/helpTopics.d.ts +15 -0
  226. package/dist-lib/ui/labels/LabelManager.d.ts +172 -9
  227. package/dist-lib/ui/labels/LabelOverlay.d.ts +19 -0
  228. package/dist-lib/ui/labels/backgroundImageSize.d.ts +19 -0
  229. package/dist-lib/ui/labels/labelModel.d.ts +64 -0
  230. package/dist-lib/ui/labels/qColor.d.ts +13 -0
  231. package/dist-lib/ui/labels/qtCss.d.ts +12 -4
  232. package/dist-lib/ui/landmarks.d.ts +9 -0
  233. package/dist-lib/ui/launcher/ActionMenu.d.ts +19 -0
  234. package/dist-lib/ui/launcher/GameDetails.d.ts +21 -0
  235. package/dist-lib/ui/launcher/GameSection.d.ts +18 -0
  236. package/dist-lib/ui/launcher/LauncherSearch.d.ts +23 -0
  237. package/dist-lib/ui/launcher/ProfileArt.d.ts +20 -0
  238. package/dist-lib/ui/launcher/ProfileSection.d.ts +43 -0
  239. package/dist-lib/ui/launcher/launcherModel.d.ts +72 -0
  240. package/dist-lib/ui/layout/overlayLayerOrder.d.ts +2 -2
  241. package/dist-lib/ui/menu/MenuBar.d.ts +31 -0
  242. package/dist-lib/ui/menu/SplitButton.d.ts +39 -0
  243. package/dist-lib/ui/menu/anchoredPopup.d.ts +74 -0
  244. package/dist-lib/ui/menu/appMenus.d.ts +65 -0
  245. package/dist-lib/ui/menu/menuModel.d.ts +88 -0
  246. package/dist-lib/ui/menu/toolbarModel.d.ts +56 -0
  247. package/dist-lib/ui/notepad.d.ts +76 -0
  248. package/dist-lib/ui/openSignInPage.d.ts +14 -0
  249. package/dist-lib/ui/output/OutputContextMenu.d.ts +14 -1
  250. package/dist-lib/ui/output/OutputRenderer.d.ts +5 -0
  251. package/dist-lib/ui/output/OutputSearchBar.d.ts +5 -1
  252. package/dist-lib/ui/output/StickyOutputPanel.d.ts +17 -3
  253. package/dist-lib/ui/output/TextAnalyzerModal.d.ts +25 -0
  254. package/dist-lib/ui/output/caretMode.d.ts +3 -2
  255. package/dist-lib/ui/output/clearSplit.d.ts +11 -0
  256. package/dist-lib/ui/output/outputCopy.d.ts +41 -2
  257. package/dist-lib/ui/output/outputRows.d.ts +43 -0
  258. package/dist-lib/ui/output/selectionGesture.d.ts +35 -0
  259. package/dist-lib/ui/output/wordSelection.d.ts +33 -0
  260. package/dist-lib/ui/search/matcher.d.ts +14 -4
  261. package/dist-lib/ui/settings/SettingsShell.d.ts +91 -0
  262. package/dist-lib/ui/settings/ShortcutEditor.d.ts +13 -0
  263. package/dist-lib/ui/sound/SoundManager.d.ts +210 -44
  264. package/dist-lib/ui/sound/closedCaption.d.ts +4 -1
  265. package/dist-lib/ui/sound/mediaDirection.d.ts +35 -0
  266. package/dist-lib/ui/tabCompletion.d.ts +53 -0
  267. package/dist-lib/ui/textedit/TextEditManager.d.ts +11 -2
  268. package/dist-lib/ui/useOpenProfiles.d.ts +1 -1
  269. package/dist-lib/ui/video/VideoManager.d.ts +7 -0
  270. package/dist-lib/ui/windows/WindowManager.d.ts +452 -37
  271. package/dist-lib/ui/windows/panels/ScriptEditorPanel.d.ts +14 -0
  272. package/dist-lib/ui/windows/panels/ScriptSearch.d.ts +6 -1
  273. package/dist-lib/ui/windows/panels/TextPanel.d.ts +4 -1
  274. package/dist-lib/ui/windows/panels/VariablesView.d.ts +37 -7
  275. package/dist-lib/ui/windows/panels/WindowCmdLine.d.ts +4 -2
  276. package/dist-lib/ui/windows/panels/aliasLoop.d.ts +24 -0
  277. package/dist-lib/ui/windows/panels/editorClipboard.d.ts +45 -0
  278. package/dist-lib/ui/windows/panels/editorUndo.d.ts +79 -0
  279. package/dist-lib/ui/windows/panels/mapAreaChange.d.ts +10 -0
  280. package/dist-lib/utils/appShellCache.d.ts +25 -0
  281. package/dist-lib/utils/fontFamilyName.d.ts +13 -0
  282. package/dist-lib/utils/fontLoader.d.ts +31 -0
  283. package/dist-lib/utils/formatBytes.d.ts +4 -0
  284. package/dist-lib/utils/mustBeOneOf.d.ts +9 -0
  285. package/dist-lib/utils/profileLock.d.ts +1 -1
  286. package/dist-lib/utils/systemTheme.d.ts +24 -0
  287. package/dist-lib/utils/timeZone.d.ts +10 -0
  288. package/dist-lib/vault/CredentialVault.d.ts +51 -5
  289. package/dist-lib/vault/deviceUnlock.d.ts +47 -0
  290. package/dist-lib/vault/vaultAccess.d.ts +24 -2
  291. package/dist-lib/vault/vaultHelpTopic.d.ts +9 -0
  292. package/dist-lib/vault/vaultRecord.d.ts +33 -1
  293. package/dist-lib/vfs-sw.js +220 -11
  294. package/dist-lib/vite.d.ts +1 -1
  295. package/dist-lib/vite.js +66 -43
  296. package/package.json +23 -15
  297. package/dist-lib/assets/mapParser.worker-t-3rd1zR.js +0 -9
  298. package/dist-lib/mud/connection/PingTracker.d.ts +0 -41
  299. package/dist-lib/ui/BundledGameGrid.d.ts +0 -21
  300. package/dist-lib/ui/ConnectionGrid.d.ts +0 -21
  301. package/dist-lib/ui/bufferWords.d.ts +0 -38
@@ -4,6 +4,7 @@ import type { AnsiAwareBuffer } from '../../mud/text/FormatState';
4
4
  import type { DockSide, MxpTabPage, WindowHandle, WindowOpenOptions, ScriptWindowRenderData } from './types';
5
5
  import { MapStore } from '../../map/MapStore';
6
6
  import { OverlayLayerOrder } from '../layout/overlayLayerOrder';
7
+ import { SubCommandLine, type CmdLineHost } from '../cmdline/subCommandLine';
7
8
  /** Live handle onto a mounted map renderer, registered by MapPanel. Backs the
8
9
  * Lua getMapZoom/setMapZoom/updateMap APIs, which need to read and drive the
9
10
  * renderer state that lives inside the React component. */
@@ -80,6 +81,8 @@ export declare class WindowManager {
80
81
  private portalHolding;
81
82
  private readonly resizeObservers;
82
83
  private readonly lastEmittedSize;
84
+ /** User windows opened but not yet reported by {@link pumpCreatedSizes}. */
85
+ private readonly createdSizesDue;
83
86
  /** Per-window last reported character grid (cols, rows) — used to gate
84
87
  * sysConsoleSizeChanged so the event fires only on actual grid changes. */
85
88
  private readonly lastEmittedGrid;
@@ -92,6 +95,18 @@ export declare class WindowManager {
92
95
  private readonly cmdLineState;
93
96
  private readonly mapCallbacks;
94
97
  private readonly mapControls;
98
+ /** See {@link hasMapper}. */
99
+ private mapperCreated;
100
+ /** The area the map widget shows, and whether a centerview has run since
101
+ * it opened (or its map went away) — what sysMapAreaChanged is worked out
102
+ * from (centerviewAreaChange). Kept here, not in MapPanel, because desktop
103
+ * builds the widget synchronously: a centerview straight after
104
+ * openMapWidget raises the event even though the panel has not mounted. */
105
+ private mapShownArea;
106
+ private mapCentered;
107
+ /** A repaint of the map widget was asked for and has not run its map info
108
+ * contributors yet — see {@link pumpMapPaint}. */
109
+ private mapPaintDue;
95
110
  /** Per-window teardown for the mousedown/mouseup listeners observeMouse
96
111
  * attaches. Keyed by window id ('main' for the central output). */
97
112
  private readonly mouseCleanups;
@@ -110,8 +125,15 @@ export declare class WindowManager {
110
125
  * awaits the map before applying scripts, Mudlet parity) and MapPanel on
111
126
  * mount call into this; whichever lands first triggers the work. */
112
127
  private mapBootstrapInflight;
128
+ /** Backing store for {@link lastMapLoadError}. */
129
+ private lastMapLoadFailure;
113
130
  private mapSaveTimer;
114
131
  private mapSavePending;
132
+ /** MapStore version that matches what is persisted (or was just loaded).
133
+ * Any other version means the map has unsaved edits — Mudlet's
134
+ * TMap::mUnsavedMap, which drives both Host::autoSaveMap and the save in
135
+ * TMainConsole::closeEvent. */
136
+ private mapCleanVersion;
115
137
  /** MMP map URL announced by the game via GMCP `Client.Map` (Mudlet
116
138
  * TMap::mMmpMapLocation). Lives here rather than on ScriptingEngine so it
117
139
  * survives script reloads, like Mudlet's TMap does. */
@@ -138,6 +160,17 @@ export declare class WindowManager {
138
160
  private nextDockOrder;
139
161
  private readonly dockExtents;
140
162
  constructor(overlayZ?: OverlayLayerOrder);
163
+ /** How long unsaved map edits wait before they are autosaved. Not reset by
164
+ * further edits, so a player mapping continuously still gets saved. */
165
+ static readonly MAP_AUTOSAVE_DELAY_MS = 10000;
166
+ /** The map now matches what is stored — nothing to autosave. */
167
+ private markMapClean;
168
+ /** Record unsaved map edits and arm an autosave, unless one is already
169
+ * armed: unlike {@link scheduleMapSave} this does not push a pending save
170
+ * back, so a steady stream of edits cannot starve it. */
171
+ private markMapUnsaved;
172
+ /** True when the map has edits not yet written to storage. */
173
+ hasUnsavedMap(): boolean;
141
174
  /** Resolves the same "nested under which parent" id FloatingWindowLayer's
142
175
  * resolveParent uses: an explicit non-'main' parent, else 'main' when this
143
176
  * is a mini-console (createMiniConsole/createMapper without an explicit
@@ -178,6 +211,11 @@ export declare class WindowManager {
178
211
  /** Bridge to the Lua speedwalk entry point (Mudlet Host::startSpeedWalk),
179
212
  * wired by ScriptingEngine. Driven by {@link startSpeedWalk}. */
180
213
  onStartSpeedWalk?: (from: number, to: number) => void;
214
+ /** Bridge to Mudlet's `postMessage` (cTelnet::postMessage, src/ctelnet.cpp:4436):
215
+ * a client message for the player, written onto the main console. Wired by
216
+ * ScriptingEngine, which applies the prefix colouring. Used by the map
217
+ * loaders to explain a refused map file instead of failing silently. */
218
+ onSystemMessage?: (text: string) => void;
181
219
  /** The MMP map URL from GMCP `Client.Map`, or '' when none announced. */
182
220
  get mmpMapLocation(): string;
183
221
  /** Record the game-announced map URL (Mudlet TMap::setMmpMapLocation). */
@@ -215,6 +253,15 @@ export declare class WindowManager {
215
253
  hints: Record<string, WindowOpenOptions>;
216
254
  dockExtents: Record<string, number>;
217
255
  }): void;
256
+ /**
257
+ * Raise the resize events for windows a layout load just placed, before the
258
+ * load returns. Desktop's restoreState resizes each dock there and then, so
259
+ * a sysUserWindowResizeEvent handler runs INSIDE loadWindowLayout() — which
260
+ * is what lets saveWindowLayout refuse to run mid-load, and openUserWindow
261
+ * notice a window a handler deleted as the layout loaded. Left to the
262
+ * ResizeObserver, those events would arrive a turn later, after the load.
263
+ */
264
+ private reportLayoutSizes;
218
265
  /** Returns the stable portal-target div for a window, creating it on first call.
219
266
  * This div is physically moved between dock slots and floating frames — the
220
267
  * panel component rendered into it never unmounts during transitions. */
@@ -252,6 +299,42 @@ export declare class WindowManager {
252
299
  */
253
300
  registerMainViewport(element: HTMLElement | null): void;
254
301
  getMainViewportElement(): HTMLElement | null;
302
+ /**
303
+ * The box the main window's size is read from: the `.main-viewport` host,
304
+ * which the console viewport spans (`inset: 0`) but which carries none of
305
+ * its padding. The borders are that padding, and desktop's borders are
306
+ * insets inside a console whose size they leave alone — measuring the
307
+ * padded viewport instead let a border wider than the console widen the
308
+ * "window" (setBorderRight(1000000) answered a window a million pixels
309
+ * wide), which every attached Adjustable.Container then took for a resize.
310
+ */
311
+ getMainSizeElement(): HTMLElement | null;
312
+ /** The `.main-viewport` box the console viewport and the overlay root both
313
+ * span (`inset: 0`). It is the one element that can be given a size — the
314
+ * two inside it are absolutely positioned against it, so sizing either of
315
+ * those alone would move the console out from under the labels. */
316
+ private mainViewportHostEl;
317
+ private mainViewportSize;
318
+ registerMainViewportHost(element: HTMLElement | null): void;
319
+ /** The `.content-layout` column — button bars, docks, the console and the
320
+ * command bar — which stands in for desktop's application window: what
321
+ * setMainWindowSize sizes, the console taking what the rest leaves. */
322
+ private mainWindowFrameEl;
323
+ registerMainWindowFrame(element: HTMLElement | null): void;
324
+ private applyMainViewportSize;
325
+ private applyMainWindowFrameSize;
326
+ /**
327
+ * Mudlet `setMainWindowSize(width, height)`. Desktop resizes the application
328
+ * window; a browser tab cannot resize itself — `window.resizeTo` is refused
329
+ * for anything the script did not open — so what is sized is the column
330
+ * that stands in for that window ({@link registerMainWindowFrame}): the
331
+ * console in it is what `getMainWindowSize` measures, and the command bar
332
+ * and button bars take their room from it as they grow, as on desktop.
333
+ * Before that column has mounted, the console's own box is sized.
334
+ *
335
+ * Returns false only when there is no viewport to size (before mount).
336
+ */
337
+ setMainWindowSize(width: number, height: number): boolean;
255
338
  /**
256
339
  * The DOM element main-parented nested windows (mini-consoles, embedded
257
340
  * mapper) portal into. This is `.main-overlay-root` — the SAME wrapper the
@@ -326,6 +409,35 @@ export declare class WindowManager {
326
409
  * sysUserWindowResizeEvent plus the console-grid and overflow events when
327
410
  * the size actually changed since last reported. */
328
411
  private measureAndEmitResize;
412
+ /** Raise sysWindowResizeEvent/sysUserWindowResizeEvent for `id` at w×h,
413
+ * unless that is the size last reported for it. */
414
+ private emitWindowSize;
415
+ /**
416
+ * The arguments of a main-window `sysWindowResizeEvent` for a main viewport
417
+ * of `w`×`h` — Mudlet's TConsole::raiseMudletSysWindowResizeEvent: the size
418
+ * of the console area left once the setBorder* insets are taken out, then
419
+ * the console's name. The viewport measured here already stops short of the
420
+ * command line, which desktop subtracts as well. getMainWindowSize() still
421
+ * reports the whole viewport, borders included — the two differ in Mudlet
422
+ * too.
423
+ */
424
+ mainResizeEventArgs(w: number, h: number): [number, number, string];
425
+ /**
426
+ * Mudlet raises sysUserWindowResizeEvent as a new user window is first laid
427
+ * out, so a handler registered before openUserWindow() hears the size the
428
+ * window arrives at. Here that report would wait for the panel to mount and
429
+ * its ResizeObserver to tick — which a script that blocks the event loop
430
+ * (a busted run, a pumpEvents() wait) never lets happen. So opening a window
431
+ * queues a report of its own, delivered on the next turn or by
432
+ * {@link pumpCreatedSizes}, whichever comes first. It carries the size
433
+ * getUserWindowSize() gives at that moment, the mounted box or the stored
434
+ * one, and the dedup in emitWindowSize keeps the observer's own first tick
435
+ * from repeating it. resizeWindow() queues one the same way, for the size
436
+ * a script just gave the window.
437
+ */
438
+ announceCreatedSize(id: string): void;
439
+ /** Deliver the reports {@link announceCreatedSize} queued. */
440
+ pumpCreatedSizes(): boolean;
329
441
  /** Measure one monospace cell (px) by probing `el` with its own inherited
330
442
  * font — the same technique getColumnCount uses, so the NAWS grid and
331
443
  * getColumnCount agree. Falls back to a fontSize estimate when the probe
@@ -337,6 +449,12 @@ export declare class WindowManager {
337
449
  * resize observer last reported — which on a fast/mobile connect may be
338
450
  * stale or not yet fired. No-op when the main element isn't mounted, or
339
451
  * when the size is unchanged (the dedup guard in emitConsoleGridIfChanged). */
452
+ /** Apply the profile's setBorder* insets to the main viewport now and
453
+ * re-measure the char grid inside them, raising sysConsoleSizeChanged if
454
+ * it moved. Host::setBorders resizes the console — and with it the text
455
+ * pane, whose resize raises that event — before it raises
456
+ * sysWindowResizeEvent, so a border change reports the grid first. */
457
+ applyMainBorders(): void;
340
458
  remeasureMainGrid(): void;
341
459
  /** Compute the rendered char-grid for `id` and emit sysConsoleSizeChanged
342
460
  * when (cols, rows) changes. Metrics are measured against the registered
@@ -348,17 +466,74 @@ export declare class WindowManager {
348
466
  * which probes the same element. Falls back to the viewport box when the
349
467
  * text element isn't mounted yet. */
350
468
  private emitConsoleGridIfChanged;
351
- /** Mudlet sysWindowOverflowEvent(name, overflowLines). Fires when a console
352
- * whose scrolling is disabled has more content than fits in the viewport.
353
- * scrollHeight − clientHeight gives the pixel overflow; dividing by the
354
- * estimated line height converts it to lines for the event payload. */
355
- private emitWindowOverflowIfPresent;
469
+ /**
470
+ * Raise sysConsoleSizeChanged(name, columns, rows, gutter) for a console
471
+ * whose character grid is now `cols` × `rows`, unless that is the grid it
472
+ * last reported — TConsole::raiseMudletResizeEvent compares against what
473
+ * it reported before. Called by the resize path above, and by a timestamp
474
+ * column being shown or hidden, which reports a grid that a font change
475
+ * (which reports nothing on its own) left unreported.
476
+ */
477
+ reportConsoleGrid(id: string, cols: number, rows: number): void;
478
+ /**
479
+ * Mudlet sysWindowOverflowEvent(name, overflowLines) — raised when a console
480
+ * that is not allowed to scroll holds more lines than its pane can show, so
481
+ * a script laying out fixed panels can react to text it has pushed out of
482
+ * sight. `lineCount` and `rows` are counted the way TConsole does it:
483
+ * lineCount includes the line the cursor is on, and the payload is how many
484
+ * lines are past the bottom.
485
+ *
486
+ * Driven from the append path (ScriptingAPI.drainWindowConsole), because
487
+ * that is where Mudlet raises it — TBuffer::append and translateToPlainText
488
+ * both call handleLinesOverflowEvent once they have added their text. It
489
+ * used to be measured here instead, off scrollHeight vs clientHeight on a
490
+ * ResizeObserver tick, which never fired for the case the event exists for:
491
+ * content growing inside an element does not resize that element, so a
492
+ * console could overflow indefinitely without a single event.
493
+ *
494
+ * The counts come from `measure`, called only for a console that cannot
495
+ * scroll: counting rows reads the pane's computed style and height, which
496
+ * forces a layout of everything the console holds. Measured up front on
497
+ * every write, that made each line written to a chat window cost more the
498
+ * fuller it was — and a console that scrolls, the default, never uses it
499
+ * (mudlet-web#439).
500
+ */
501
+ noteLineOverflow(id: string, measure: () => {
502
+ lineCount: number;
503
+ rows: number;
504
+ }): void;
356
505
  /** Raise Mudlet's sysWindowMousePress/ReleaseEvent for clicks anywhere on a
357
506
  * window's box. Args mirror Mudlet: (button, x, y, name) where button is
358
507
  * 1=left, 2=right, 3=middle, 4=back, 5=forward (0 = anything else), x/y are
359
508
  * pixel coordinates relative to the window, and name is the window id
360
- * ('main' for the central output). */
509
+ * ('main' for the central output).
510
+ *
511
+ * Desktop's ordering is what shapes the wiring:
512
+ * - The press is raised before anything inside the console acts on it — a
513
+ * link runs between the press and release events (TConsole raises the
514
+ * press, then TTextEdit::mousePressEvent runs the link), so the press
515
+ * listens in the capture phase, ahead of the link's own handler.
516
+ * - Qt gives the release to the widget the press went to (its implicit
517
+ * mouse grab), wherever the pointer is let go, so the release is raised
518
+ * for the window that took the press, from a document listener.
519
+ * - A press on a label or a nested window belongs to that widget: labels
520
+ * pass on only what they have no callback for (see
521
+ * {@link raiseUnhandledMouse}), and a nested window raises its own. */
361
522
  private observeMouse;
523
+ /** The window holding Qt's implicit mouse grab: the one the last press
524
+ * went to, until every button is up again. */
525
+ private mouseGrab;
526
+ private mouseReleaseListener;
527
+ private installMouseReleaseListener;
528
+ private raiseWindowMouse;
529
+ /**
530
+ * A press or release a label had no callback for. TLabel::mousePressEvent
531
+ * and mouseReleaseEvent hand an event they don't use on to the widget
532
+ * under them — the label's window — which raises it as its own
533
+ * sysWindowMousePressEvent / sysWindowMouseReleaseEvent, at the pointer's
534
+ * position in that window.
535
+ */
536
+ raiseUnhandledMouse(kind: 'press' | 'release', windowId: string, e: MouseEvent): void;
362
537
  /** Mudlet `sysDropEvent(filepath, suffix, x, y, name)` and
363
538
  * `sysDropUrlEvent(url, schema, x, y, name)` — fired when the user drags
364
539
  * a file or URL onto a window. We only acknowledge drops we can identify
@@ -368,7 +543,40 @@ export declare class WindowManager {
368
543
  private observeDrop;
369
544
  registerMapCallback(id: string, cb: (roomId: number) => void): void;
370
545
  unregisterMapCallback(id: string): void;
371
- centerView(roomId: number): boolean;
546
+ /**
547
+ * Mudlet `centerview(roomID [, viewID])`.
548
+ *
549
+ * With a view id it centres THAT window and returns; the player is not
550
+ * moved. Only the primary mapper's form writes mRoomIdHash — a secondary
551
+ * view is somewhere the player is looking, not somewhere they are, and
552
+ * T2DMap::centerview returns before the block that records a position.
553
+ */
554
+ centerView(roomId: number, viewId?: number): boolean | string;
555
+ /**
556
+ * Run the map info contributors as a paint of the map widget would
557
+ * (T2DMap::paintEvent → dlgMapper::paintMapInfo), for the paint that
558
+ * updateMap() or a centerview asked for. MapPanel does this on its own
559
+ * render, but a script that blocks the event loop (a busted run, a
560
+ * pumpEvents() wait) never lets React render — where desktop's
561
+ * pumpEvents delivers the queued repaint. So the busted pump calls this,
562
+ * and a contributor runs as it would on desktop: with the selection's
563
+ * centre or else the player's room, and not at all without one.
564
+ */
565
+ pumpMapPaint(): boolean;
566
+ /** Whether a map widget (not a secondary map view) is open. */
567
+ private hasMapWidget;
568
+ /** MapPanel reports the area it switched to (the area picker, or the view
569
+ * restored on open), so the next centerview's sysMapAreaChanged names it
570
+ * as the previous area. */
571
+ noteMapArea(areaId: number): void;
572
+ /** The map went away (deleteMap, a failed load): whatever map comes next is
573
+ * shown fresh, so its first centerview reports -2 as the previous area. */
574
+ resetMapArea(): void;
575
+ /** The area a map view is showing, or a refusal when there is no such view.
576
+ * A view ignores the areaID a caller hands setMapZoom/getMapZoom and uses
577
+ * this one — TMapView::setZoom throws the argument away and passes
578
+ * getCurrentAreaId(). */
579
+ mapViewArea(viewId: number): number | string;
372
580
  /**
373
581
  * Mudlet `T2DMap::initiateSpeedWalk` — start a speedwalk from the player's
374
582
  * current room to `targetRoomId`, the room the user double-clicked on the
@@ -384,9 +592,15 @@ export declare class WindowManager {
384
592
  */
385
593
  startSpeedWalk(targetRoomId: number): boolean;
386
594
  registerMapControl(id: string, ctrl: MapControl): void;
595
+ /** Whether a mapper has been created this session — Mudlet's
596
+ * `mpMap->mpMapper`, which getPlayerRoom requires before it reports a
597
+ * room at all. Desktop makes one when the map is first shown (the Map
598
+ * button, openMapWidget, createMapper) or loaded (loadMap), and keeps it,
599
+ * hidden, when the dock is closed — so this latches. */
600
+ hasMapper(): boolean;
387
601
  unregisterMapControl(id: string): void;
388
602
  /** Live zoom of the displayed 2D map, or null when no map panel is mounted.
389
- * mudix shows one area at a time through a single shared renderer, so the
603
+ * Mudlet Web shows one area at a time through a single shared renderer, so the
390
604
  * Mudlet `areaID` argument has no per-area analogue here — callers get the
391
605
  * current view's zoom regardless. */
392
606
  getMapZoom(): number | null;
@@ -459,11 +673,37 @@ export declare class WindowManager {
459
673
  * Parse a Mudlet `.dat` buffer and apply it to this session's MapStore.
460
674
  * Rooms / areas / hashes / labels / env colours / map-level user data all
461
675
  * land in {@link MapStore} via {@link MapStore.loadFromBinary}; the
462
- * renderer reads it back through the live {@link MudixMapReader}. Throws
676
+ * renderer reads it back through the live {@link MudletMapReader}. Throws
463
677
  * on parse failure so callers can surface the error (the file-upload path
464
678
  * in MapPanel turns it into status='error'; bootstrap logs and moves on).
465
679
  */
466
- ingestMapBuffer(buf: ArrayBuffer): void;
680
+ ingestMapBuffer(buf: ArrayBuffer, source?: string): void;
681
+ /**
682
+ * Report a failed map load the way Mudlet does: an unreadable format
683
+ * version gets its explanation on the main console (TMap::readMap posts
684
+ * every out-of-range case through postMessage, src/TMap.cpp:1531-1573)
685
+ * rather than being swallowed into a console.warn the player never sees.
686
+ * Everything else stays a developer-facing warning.
687
+ */
688
+ private reportMapLoadFailure;
689
+ /** Reason the most recent map load failed, or null when the last one
690
+ * succeeded. The map panel shows this in its error slot — "Failed to parse
691
+ * map file" alone leaves a rejected format version looking like corruption. */
692
+ get lastMapLoadError(): string | null;
693
+ /** How many audit lines one load is allowed to put on the console. A map
694
+ * with a systematic fault has one per room, and thousands of them would
695
+ * push the game's own output out of the scrollback — which is the thing the
696
+ * player was reading when they turned the option on. */
697
+ private static readonly MAX_MAP_ISSUES_POSTED;
698
+ /**
699
+ * Mudlet's "report map issues on screen" (`mudlet::showMapAuditErrors`,
700
+ * consulted at every `postMessage` in TRoom/TRoomDB/TMap's audit).
701
+ *
702
+ * Called after a load has finished. Every load path audits and repairs the
703
+ * map as Mudlet's TMap::audit does (MapStore.auditMap), so the report is
704
+ * already collected; this only decides whether the player sees it.
705
+ */
706
+ private reportMapIssues;
467
707
  /**
468
708
  * Async sibling of {@link ingestMapBuffer} that parses in a worker so the
469
709
  * main thread stays free for paint. `buf` is transferred — callers that
@@ -478,7 +718,7 @@ export declare class WindowManager {
478
718
  * Batch progress is published on {@link subscribeMapLoadProgress} for the
479
719
  * map panel's progress bar; `onProgress` is an extra per-call hook.
480
720
  */
481
- ingestMapBufferAsync(buf: ArrayBuffer, onProgress?: (loaded: number, total: number) => void): Promise<void>;
721
+ ingestMapBufferAsync(buf: ArrayBuffer, onProgress?: (loaded: number, total: number) => void, source?: string): Promise<void>;
482
722
  /**
483
723
  * Mudlet parity: a map is available to scripts before `sysLoadEvent` fires.
484
724
  * ScriptingEngine awaits this in its start() path so the initial script
@@ -494,12 +734,13 @@ export declare class WindowManager {
494
734
  * into the manager/store, and any open MapPanel is asked to re-render.
495
735
  * Without a buffer the panel is told to reload from cache. Returns false
496
736
  * on synchronous parse failure; the IndexedDB write is fire-and-forget
497
- * (failures appear in console.warn). Fires sysMapLoadEvent on success.
737
+ * (failures appear in console.warn). Raises no event: desktop has no
738
+ * sysMapLoadEvent, so a script waiting on one would never run there.
498
739
  */
499
- loadMap(buf?: ArrayBuffer): boolean;
740
+ loadMap(buf?: ArrayBuffer, source?: string): boolean;
500
741
  /**
501
742
  * Async sibling of {@link loadMap} with identical effects — IndexedDB
502
- * persistence, store ingest, panel re-render, `sysMapLoadEvent` — but the
743
+ * persistence, store ingest, panel re-render — but the
503
744
  * parse runs in the worker and streams into the store, publishing progress
504
745
  * as it goes.
505
746
  *
@@ -511,7 +752,7 @@ export declare class WindowManager {
511
752
  *
512
753
  * `buf` is transferred to the worker and must not be reused by the caller.
513
754
  */
514
- loadMapAsync(buf: ArrayBuffer): Promise<boolean>;
755
+ loadMapAsync(buf: ArrayBuffer, source?: string): Promise<boolean>;
515
756
  /**
516
757
  * Mudlet `saveMap([location])`. Serialises the in-memory MapStore to the
517
758
  * Mudlet binary `.dat` format and persists it to this connection's
@@ -544,19 +785,41 @@ export declare class WindowManager {
544
785
  * completes because the worker and IDB outlive the session instance.
545
786
  */
546
787
  flushMapSave(): void;
788
+ /**
789
+ * Page-unload counterpart to {@link flushMapSave}: a worker round trip may
790
+ * not finish before the page is gone, so serialise on this thread and
791
+ * start the IndexedDB write now. Mudlet saves an unsaved map on close
792
+ * (TMainConsole::closeEvent → saveMapFile); without this, rooms a script
793
+ * added since the last autosave are lost when the tab closes.
794
+ */
795
+ flushMapSaveSync(): void;
547
796
  /**
548
797
  * Mudlet `saveJsonMap(path)` backbone — serialise the current MapStore
549
798
  * to a JSON string. Used by the Lua binding, which writes the result to
550
799
  * the VFS path the script provided.
551
800
  */
552
- saveJsonMap(): string;
801
+ /** Mudlet's own interchange schema, not the binary model — a file written
802
+ * here has to open in Mudlet, and be readable by anything that parses it
803
+ * directly. */
804
+ /** Every distinct room symbol the map uses; see symbolsThisFontCannotDraw. */
805
+ mapRoomSymbols(): string[];
806
+ /** Mudlet's "Show symbol usage…" data: each symbol with the rooms using it,
807
+ * commonest first. */
808
+ mapRoomSymbolUsage(): {
809
+ symbol: string;
810
+ rooms: number[];
811
+ }[];
812
+ saveJsonMap(extras?: Record<string, unknown>): string;
553
813
  /**
554
814
  * Mudlet `loadJsonMap(path)` backbone — parse a JSON payload previously
555
815
  * produced by `saveJsonMap` and replace MapStore's contents, then ask any
556
816
  * open map panel to re-render. Returns false on parse failure or when the
557
817
  * JSON doesn't carry the expected MudletMap shape.
558
818
  */
559
- loadJsonMap(json: string): boolean;
819
+ loadJsonMap(json: string, source?: string): boolean;
820
+ private lastMapReport;
821
+ /** The report the last loadJsonMap wrote for log/errors.txt, once. */
822
+ takeMapReport(): string;
560
823
  /**
561
824
  * Import an IRE-style XML map (Mudlet TConsole::importMap →
562
825
  * XMLimport::readMap) — the format `loadMap("...xml")` and MMP map
@@ -568,11 +831,17 @@ export declare class WindowManager {
568
831
  loadMapXml(xmlText: string): boolean;
569
832
  markAsMiniConsole(id: string): void;
570
833
  isMiniConsole(id: string): boolean;
834
+ /** Whether `id` is a text console (a user window or miniconsole) rather
835
+ * than a map or HTML panel. */
836
+ isTextWindow(id: string): boolean;
571
837
  /** Flag a console as an MXP frame so it renders with a frame border. Also
572
838
  * hides its scrollbar: Mudlet's frames are `TConsole::SubConsole`s, which
573
839
  * start with theirs hidden, and no MXP server ever calls enableScrollBar.
574
840
  * Idempotent — the layout re-places a frame on every reflow. */
575
841
  markAsMxpFrame(id: string): void;
842
+ /** Whether `id` is an MXP frame's own console — false once a script has
843
+ * deleted it, even if it then made a window of its own under the name. */
844
+ isMxpFrame(id: string): boolean;
576
845
  /** Install (or replace) an MXP frame's tab strip. An empty `pages` list
577
846
  * removes it. Pages other than the active one are hidden, which keeps their
578
847
  * panel mounted — the content pool renders every open window regardless of
@@ -600,6 +869,19 @@ export declare class WindowManager {
600
869
  bottom: number;
601
870
  left: number;
602
871
  }): void;
872
+ /** Write the console insets straight onto the main viewport, on top of
873
+ * notifying React to render the same values.
874
+ *
875
+ * A server's frames and the script that reads what they cost are in the
876
+ * same turn: `<FRAME ALIGN=left WIDTH=25%>` and the getColumnCount() that
877
+ * measures what is left of the main window both happen before React can
878
+ * render anything, so a caller waiting on the React path measures the
879
+ * window as it was and lays its own output out over the frame. The browser
880
+ * reflows on the next geometry read either way, so writing the padding
881
+ * here makes that measurement the true one. React then renders the
882
+ * identical value, and the two never disagree — the sum is computed the
883
+ * same way in both places (OutputArea's contentStyle). */
884
+ private applyMainViewportInsets;
603
885
  getRoomIDbyHash(hash: string): number | undefined;
604
886
  setPosition(id: string, x: number, y: number): void;
605
887
  /** Mudlet setWindow for miniconsole / mapper panels — re-portal the panel
@@ -659,13 +941,20 @@ export declare class WindowManager {
659
941
  */
660
942
  scrollBarVisible(id: string): boolean;
661
943
  /** Mudlet enable/disableHorizontalScrollBar — toggle a horizontal scrollbar
662
- * on a console wrapper. mudix wraps long lines by default so this is rarely
944
+ * on a console wrapper. Mudlet Web wraps long lines by default so this is rarely
663
945
  * needed; included for parity. */
664
946
  setHorizontalScrollBarVisible(id: string, visible: boolean): void;
665
947
  /** Mudlet enable/disableScrolling — when disabled, the wrapper sticks to the
666
948
  * bottom (wheel/touch/keys cannot scroll back). Mudlet forbids this on the
667
- * main window; we follow that policy. Returns false on 'main', true otherwise. */
949
+ * main window; we follow that policy. Returns false on 'main', true otherwise.
950
+ * Disabling also closes the split view (TConsole::setScrolling calls
951
+ * clearSplit), so a console a script had scrolled up does not stay parked
952
+ * there with no way left to scroll it down. */
668
953
  setScrollingEnabled(id: string, enabled: boolean): boolean;
954
+ /** Mudlet `TConsole::clearSplit` for a script: forget any scrolled-to line
955
+ * and put the console back on its tail. The renderer's own scroll handler
956
+ * sees the wrapper reach the bottom and drops the split pane. */
957
+ clearSplit(id: string): void;
669
958
  /**
670
959
  * Mudlet `timeStampsEnabled(window)` — whether the console is showing its
671
960
  * timestamp column. Null when the window has no renderer registered, which
@@ -686,14 +975,6 @@ export declare class WindowManager {
686
975
  * allowed. Always true for `'main'`, which setScrollingEnabled refuses to
687
976
  * change, and true for any console nobody has called disableScrolling on. */
688
977
  isScrollingEnabled(id: string): boolean;
689
- /** Buffer-line index of the topmost visible line in `id`'s wrapper. In tail
690
- * mode returns the last line number (matching Mudlet's mCursorY behaviour at
691
- * the end of the buffer). Returns 0 if the element is unmounted or empty.
692
- *
693
- * Uses getBoundingClientRect rather than offsetTop because `.output-container`
694
- * is `position: relative` — child offsetTop is relative to *that*, not to the
695
- * scroll-container `.output-wrapper`, so the rectangles are the unambiguous
696
- * way to relate child position to the scroll viewport. */
697
978
  /** Whether `id`'s wrapper is mounted with laid-out lines, i.e. whether
698
979
  * {@link getScrollLine}'s measurement means anything. A console whose panel
699
980
  * isn't on screen yet measures as 0, which is indistinguishable from being
@@ -703,7 +984,7 @@ export declare class WindowManager {
703
984
  * Where `scrollTo` last parked each console, as a buffer line index; absent
704
985
  * means tail mode (or that only the user has scrolled it).
705
986
  *
706
- * Mudlet's getScroll/scrollTo are buffer-index operations. mudix measured
987
+ * Mudlet's getScroll/scrollTo are buffer-index operations. Mudlet Web measured
707
988
  * the DOM instead, which is fine for a console the player is looking at but
708
989
  * answers nothing useful for one whose panel has not been laid out yet — and
709
990
  * a script that scrolls and reads back in the same breath never gives React
@@ -711,18 +992,77 @@ export declare class WindowManager {
711
992
  * and the measurement is the fallback, not the source of truth.
712
993
  */
713
994
  private readonly scriptScrollLine;
995
+ /** The buffer dropped `removed` lines off its top (TBuffer::shrinkBuffer).
996
+ * A console scrolled back keeps showing the lines it showed, which are now
997
+ * that many lines nearer the start, so the line a script parked it on
998
+ * moves up with them, as desktop's upper pane cursor does. */
999
+ noteLinesRemoved(id: string, removed: number): void;
1000
+ /** Whether `id` follows its output (desktop's TTextEdit::mIsTailMode):
1001
+ * neither a script nor the reader has scrolled it back. */
1002
+ followsNewLines(id: string): boolean;
714
1003
  /** Called when the *user* scrolls a console, so a script's remembered
715
1004
  * position stops overriding what they can see. */
716
1005
  noteUserScroll(id: string): void;
717
- getScrollLine(id: string): number;
718
- /** Scroll `id`'s wrapper so `line` (0-indexed) sits at the top. `undefined`
719
- * resumes tail mode (scroll-to-bottom); negative values count from the end
720
- * (Mudlet semantics). Returns false if the wrapper is not mounted. */
1006
+ /** The wrapper's scrollTop as scrollToLine left it. A scroll event that
1007
+ * lands anywhere else was the reader's (wheel, scroll bar, PageUp, the
1008
+ * split view closing), so the scripted position stops being the answer. */
1009
+ private readonly scriptScrollTop;
1010
+ /**
1011
+ * Wrappers the reader has scrolled back from the end of — the inverse of
1012
+ * desktop's `TTextEdit::mIsTailMode`. Kept from scroll events rather than
1013
+ * measured when asked: new output is appended before the renderer scrolls
1014
+ * down to it, so in between a console that is following its output measures
1015
+ * as some way up — right after a burst of echoes, at the very top. Desktop
1016
+ * stays in tail mode through that, and so does this; only a scroll that
1017
+ * actually leaves the end takes a console out of it.
1018
+ */
1019
+ private readonly scrolledBack;
1020
+ private watchTail;
1021
+ /** Height of the split view's lower pane laid over the bottom of `el` —
1022
+ * the sticky area StickyOutputPanel renders as the wrapper's sibling. It
1023
+ * keeps its height while hidden, which is the height it will cover once a
1024
+ * scroll back raises it. */
1025
+ private splitPaneHeight;
1026
+ /** The height the split view's lower pane takes off `id`'s upper pane
1027
+ * while it is open — the console scrolled back, by hand or by script —
1028
+ * and 0 while the console follows its output. A console with no panel to
1029
+ * measure yet, scrolled back by a script, has the pane at the height it
1030
+ * opens at. */
1031
+ openSplitPaneHeight(id: string): number;
1032
+ /** Mudlet's scroll position for `id`'s wrapper, or null while it follows
1033
+ * its output (tail mode), where Mudlet's getScroll answers the last line —
1034
+ * which the caller takes from the buffer, since the DOM's line count is not
1035
+ * the buffer's. Returns 0 if the element is unmounted or empty.
1036
+ *
1037
+ * Desktop's position is the upper pane's `mCursorY`, and that pane draws
1038
+ * the rows *above* it (TTextEdit::imageTopLine is `mCursorY -
1039
+ * mScreenHeight`): the number is the first line below the scrolled view,
1040
+ * one past its bottom row — not the top row. The scrolled view ends where
1041
+ * the split view's lower pane begins, so that pane's height comes off the
1042
+ * bottom.
1043
+ *
1044
+ * Uses getBoundingClientRect rather than offsetTop because `.output-container`
1045
+ * is `position: relative` — child offsetTop is relative to *that*, not to the
1046
+ * scroll-container `.output-wrapper`, so the rectangles are the unambiguous
1047
+ * way to relate child position to the scroll viewport. */
1048
+ getScrollLine(id: string): number | null;
1049
+ /** Mudlet `scrollTo(window, line)`: scroll `id`'s wrapper so `line` is the
1050
+ * first line below the scrolled view — its bottom row is `line - 1`, the
1051
+ * same edge {@link getScrollLine} reads. `undefined`, or a line at or past
1052
+ * the last one, resumes tail mode (TMainConsole::scrollWindowTo); negative
1053
+ * values count back from the last line. Returns false if the console has
1054
+ * neither a buffer nor a mounted wrapper. */
721
1055
  scrollToLine(id: string, line: number | undefined): boolean;
1056
+ /** Mudlet's PageUp / PageDown in the command line (TCommandLine::event):
1057
+ * scroll `id`'s console a page — the scrolled view's height, the split
1058
+ * pane excluded — up or down. Paging down into what the split pane already
1059
+ * shows closes it and resumes tail mode, as TConsole::scrollDown does. */
1060
+ scrollPage(id: string, direction: 'up' | 'down'): void;
722
1061
  private getScrollStateMut;
723
1062
  private applyScrollClasses;
724
- /** Direct line-element children of the wrapper (skips the sticky-output
725
- * sentinel, which sits at the end with height: 0). */
1063
+ /** The wrapper's line elements, in order, through its scrollback blocks
1064
+ * (skips the sticky-output sentinel, which sits at the end with
1065
+ * height: 0). */
726
1066
  private lineElements;
727
1067
  /** Mudlet setBackgroundColor for a userwindow / miniconsole. */
728
1068
  setBackgroundColor(id: string, r: number, g: number, b: number, a?: number): boolean;
@@ -760,11 +1100,58 @@ export declare class WindowManager {
760
1100
  * window's command line. Pass null to clear. Returns false when the
761
1101
  * window doesn't exist. */
762
1102
  setCmdLineAction(id: string, cb: ((text: string) => void) | null): boolean;
1103
+ /**
1104
+ * How much taller (positive) or shorter (negative) window `id`'s text pane
1105
+ * is about to be than it measures now: enable/disableCommandLine change
1106
+ * whether it has a command line under it at once, but the panel only takes
1107
+ * the input in or out on its next render, which a script still running
1108
+ * does not let happen. getRowCount adds this so it counts the rows the pane
1109
+ * has, not the ones it had.
1110
+ */
1111
+ pendingCmdLineHeightDelta(id: string): number;
1112
+ /** The height a window's one-row command line takes, measured once off a
1113
+ * hidden probe styled as the real one; 0 where nothing can be measured. */
1114
+ private cmdLineHeight;
1115
+ private measuredCmdLineHeight;
1116
+ /** Whether window `id` has a command line of its own: one enableCommandLine
1117
+ * made, which disableCommandLine only hides. A console that never had one
1118
+ * enabled has none (#342). */
1119
+ hasCommandLine(id: string): boolean;
1120
+ /** Window `id`'s command-line keyboard state, or null when it has none. */
1121
+ cmdLineModel(id: string): SubCommandLine | null;
1122
+ /** The profile settings and Tab pool every command line reads. Set by the
1123
+ * ScriptingEngine. */
1124
+ cmdLineHost: CmdLineHost;
1125
+ /**
1126
+ * Mudlet deleteCommandLine(name) on a miniconsole's or user window's own
1127
+ * line (TMainConsole::deleteCommandLine finds it in mSubCommandLineMap,
1128
+ * under the console's name): the line goes, action and history with it,
1129
+ * and the console has none until enableCommandLine makes a new one.
1130
+ * False when it has none.
1131
+ */
1132
+ deleteCommandLine(id: string): boolean;
1133
+ /** What a script last put on window `id`'s command line, and the count
1134
+ * that changes with every such write. */
1135
+ cmdLineSeed(id: string): {
1136
+ value: string;
1137
+ seq: number;
1138
+ } | null;
763
1139
  /** Whether a script has bound a per-window Enter handler. */
764
1140
  hasCmdLineAction(id: string): boolean;
765
1141
  /** Read the bound callback (or null). The TextPanel input invokes this
766
1142
  * directly on Enter so the React tree never sees the function. */
767
1143
  getCmdLineAction(id: string): ((text: string) => void) | null;
1144
+ /** Where Enter goes on a window command line with no action bound: the
1145
+ * game, as typed input, then echoed into window `id` itself. Set by the
1146
+ * ScriptingEngine. */
1147
+ onCmdLineDefaultSend?: (text: string, id: string) => void;
1148
+ /**
1149
+ * The user pressed Enter in window `id`'s command line. Runs the bound
1150
+ * action, or else sends the text, as Mudlet's TCommandLine::enterCommand
1151
+ * falls back to `Host::send`. Returns whether anything took the text, i.e.
1152
+ * whether the line should clear.
1153
+ */
1154
+ submitCmdLine(id: string, text: string): boolean;
768
1155
  /** Mudlet clearCmdLine([name]) when name is a userwindow — wipes the
769
1156
  * input contents. The seq bump forces React to apply the seed even
770
1157
  * when the value didn't change. Returns false when the window doesn't
@@ -808,6 +1195,8 @@ export declare class WindowManager {
808
1195
  hide(id: string): void;
809
1196
  show(id: string): boolean;
810
1197
  isVisible(id: string): boolean;
1198
+ /** Whether the window sits in a dock (rather than floating). */
1199
+ isDocked(id: string): boolean;
811
1200
  /** Stored geometry for a user window / miniconsole — deliberately the saved
812
1201
  * x/y/width/height rather than {@link getSize}'s live DOM rect, so it is an
813
1202
  * exact inverse of moveWindow/resizeWindow (Mudlet's getWindowGeometry
@@ -818,6 +1207,28 @@ export declare class WindowManager {
818
1207
  width: number;
819
1208
  height: number;
820
1209
  } | null;
1210
+ /** The dock frame (title bar and content) a docked window is shown in. */
1211
+ private dockFrame;
1212
+ /**
1213
+ * Lay the windows out NOW rather than on React's next render, so the script
1214
+ * line after a dock change already sees the sizes it produced.
1215
+ *
1216
+ * Desktop docks synchronously: by the time openUserWindow() returns, the
1217
+ * dock has its size, the main console has shrunk to make room and
1218
+ * sysWindowResizeEvent has fired, so getUserWindowSize, getMainWindowSize
1219
+ * and getWindowGeometry all answer with the final layout. Here the layout is
1220
+ * React state, which commits on a later turn — scripts that positioned
1221
+ * things right after creating a docked window read the pre-dock numbers.
1222
+ * flushSync commits that render (and the panels' mount effects) before it
1223
+ * returns, so the DOM — which every geometry getter measures — is already
1224
+ * the docked layout, and the main viewport's resize is raised on the spot
1225
+ * like setMainWindowSize does; the observer's own tick dedupes to nothing.
1226
+ *
1227
+ * A no-op beyond the measure when no layout is mounted. When called from
1228
+ * inside a React render or effect, React refuses to flush and the layout
1229
+ * catches up on its own turn, as it always did.
1230
+ */
1231
+ settleLayout(): void;
821
1232
  /** The window this one nests inside, or null for a root floating window.
822
1233
  * Used by the ancestor-aware windowVisible walk. */
823
1234
  parentOf(id: string): string | null;
@@ -837,9 +1248,10 @@ export declare class WindowManager {
837
1248
  getTitle(id: string): string | null;
838
1249
  /**
839
1250
  * The title a window carries when nobody has set one. Mudlet builds it from
840
- * the profile and the window's own name ("<profile> - <window>"), which is
841
- * what a player sees on a freshly opened user window; mudix used to fall
842
- * back to the bare id, so resetting a title lost the profile half of it.
1251
+ * the profile and the window's own name ("User window - <profile> -
1252
+ * <window>", TMainConsole's tr() string), which is what
1253
+ * setUserWindowTitle(name) with no title goes back to; Mudlet Web used to
1254
+ * fall back to the bare id, then to "<profile> - <window>" (mudlet-web#380).
843
1255
  * The profile name is injected by ScriptingAPI — the manager has no other
844
1256
  * reason to know it.
845
1257
  */
@@ -847,6 +1259,9 @@ export declare class WindowManager {
847
1259
  defaultTitle(id: string): string;
848
1260
  focus(id: string): void;
849
1261
  has(id: string): boolean;
1262
+ /** The record behind `id`, compared by identity to tell a window from one
1263
+ * put in its place under the same name. */
1264
+ record(id: string): object | undefined;
850
1265
  getElement(id: string): HTMLElement | null;
851
1266
  /** Mudlet getUserWindowSize. Reports the live rendered size of a userwindow
852
1267
  * / miniconsole when mounted (so docked panels return their actual on-screen