@mudlet/mudlet-web 0.4.5 → 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.
Files changed (308) 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 +50660 -29735
  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 +432 -59
  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 +54 -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 +1039 -213
  149. package/dist-lib/scripting/ScriptingEngine.d.ts +753 -103
  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 +521 -44
  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/CharLoginModal.d.ts +24 -15
  192. package/dist-lib/ui/CmdLineMenuRegistry.d.ts +14 -5
  193. package/dist-lib/ui/CommandBar.d.ts +8 -8
  194. package/dist-lib/ui/ConnectionFormModal.d.ts +25 -1
  195. package/dist-lib/ui/ConnectionScreen.d.ts +9 -1
  196. package/dist-lib/ui/GameLinkPrompt.d.ts +28 -0
  197. package/dist-lib/ui/HelpModal.d.ts +5 -1
  198. package/dist-lib/ui/MapSymbolUsageModal.d.ts +32 -0
  199. package/dist-lib/ui/MouseEventRegistry.d.ts +31 -4
  200. package/dist-lib/ui/NotepadModal.d.ts +22 -0
  201. package/dist-lib/ui/ResizableModal.d.ts +16 -1
  202. package/dist-lib/ui/SettingsModal.d.ts +10 -1
  203. package/dist-lib/ui/TlsAlertBanner.d.ts +3 -1
  204. package/dist-lib/ui/Toolbar.d.ts +22 -1
  205. package/dist-lib/ui/VaultManageButton.d.ts +20 -0
  206. package/dist-lib/ui/VaultModal.d.ts +5 -0
  207. package/dist-lib/ui/VaultUnlockPrompt.d.ts +15 -0
  208. package/dist-lib/ui/buttons/ButtonsBar.d.ts +3 -1
  209. package/dist-lib/ui/buttons/inactiveButtons.d.ts +25 -0
  210. package/dist-lib/ui/cmdline/CommandLineManager.d.ts +19 -0
  211. package/dist-lib/ui/cmdline/plainText.d.ts +16 -0
  212. package/dist-lib/ui/cmdline/subCommandLine.d.ts +78 -0
  213. package/dist-lib/ui/cmdline/useCmdLineSelection.d.ts +26 -0
  214. package/dist-lib/ui/cmdline/useSubCommandLineKeys.d.ts +33 -0
  215. package/dist-lib/ui/codemirror/lineParagraphMarks.d.ts +19 -0
  216. package/dist-lib/ui/codemirror/luaHover.d.ts +7 -0
  217. package/dist-lib/ui/codemirror/options.d.ts +33 -0
  218. package/dist-lib/ui/codemirror/theme.d.ts +29 -5
  219. package/dist-lib/ui/commands/addonCommands.d.ts +134 -0
  220. package/dist-lib/ui/commands/appShortcuts.d.ts +86 -0
  221. package/dist-lib/ui/commands/hostCommands.d.ts +88 -0
  222. package/dist-lib/ui/commands/keyMatch.d.ts +20 -0
  223. package/dist-lib/ui/commands/keySequence.d.ts +57 -0
  224. package/dist-lib/ui/components/ContextMenu.d.ts +21 -1
  225. package/dist-lib/ui/components/FontPicker.d.ts +5 -1
  226. package/dist-lib/ui/components/useModalFocus.d.ts +13 -1
  227. package/dist-lib/ui/helpTopics.d.ts +15 -0
  228. package/dist-lib/ui/labels/LabelManager.d.ts +172 -9
  229. package/dist-lib/ui/labels/LabelOverlay.d.ts +19 -0
  230. package/dist-lib/ui/labels/backgroundImageSize.d.ts +19 -0
  231. package/dist-lib/ui/labels/labelModel.d.ts +64 -0
  232. package/dist-lib/ui/labels/qColor.d.ts +13 -0
  233. package/dist-lib/ui/labels/qtCss.d.ts +12 -4
  234. package/dist-lib/ui/landmarks.d.ts +9 -0
  235. package/dist-lib/ui/launcher/ActionMenu.d.ts +19 -0
  236. package/dist-lib/ui/launcher/GameDetails.d.ts +21 -0
  237. package/dist-lib/ui/launcher/GameSection.d.ts +18 -0
  238. package/dist-lib/ui/launcher/LauncherSearch.d.ts +23 -0
  239. package/dist-lib/ui/launcher/ProfileArt.d.ts +20 -0
  240. package/dist-lib/ui/launcher/ProfileSection.d.ts +43 -0
  241. package/dist-lib/ui/launcher/launcherModel.d.ts +72 -0
  242. package/dist-lib/ui/layout/overlayLayerOrder.d.ts +2 -2
  243. package/dist-lib/ui/menu/MenuBar.d.ts +31 -0
  244. package/dist-lib/ui/menu/SplitButton.d.ts +39 -0
  245. package/dist-lib/ui/menu/anchoredPopup.d.ts +74 -0
  246. package/dist-lib/ui/menu/appMenus.d.ts +65 -0
  247. package/dist-lib/ui/menu/menuModel.d.ts +88 -0
  248. package/dist-lib/ui/menu/toolbarModel.d.ts +56 -0
  249. package/dist-lib/ui/notepad.d.ts +76 -0
  250. package/dist-lib/ui/openSignInPage.d.ts +14 -0
  251. package/dist-lib/ui/output/OutputContextMenu.d.ts +14 -1
  252. package/dist-lib/ui/output/OutputRenderer.d.ts +5 -0
  253. package/dist-lib/ui/output/OutputSearchBar.d.ts +5 -1
  254. package/dist-lib/ui/output/StickyOutputPanel.d.ts +17 -3
  255. package/dist-lib/ui/output/TextAnalyzerModal.d.ts +25 -0
  256. package/dist-lib/ui/output/caretMode.d.ts +3 -2
  257. package/dist-lib/ui/output/clearSplit.d.ts +11 -0
  258. package/dist-lib/ui/output/outputCopy.d.ts +41 -2
  259. package/dist-lib/ui/output/outputRows.d.ts +43 -0
  260. package/dist-lib/ui/output/selectionGesture.d.ts +35 -0
  261. package/dist-lib/ui/output/wordSelection.d.ts +33 -0
  262. package/dist-lib/ui/search/matcher.d.ts +14 -4
  263. package/dist-lib/ui/settings/SettingsShell.d.ts +91 -0
  264. package/dist-lib/ui/settings/ShortcutEditor.d.ts +13 -0
  265. package/dist-lib/ui/sound/SoundManager.d.ts +210 -44
  266. package/dist-lib/ui/sound/closedCaption.d.ts +4 -1
  267. package/dist-lib/ui/sound/mediaDirection.d.ts +35 -0
  268. package/dist-lib/ui/tabCompletion.d.ts +53 -0
  269. package/dist-lib/ui/textedit/TextEditManager.d.ts +11 -2
  270. package/dist-lib/ui/useOpenProfiles.d.ts +1 -1
  271. package/dist-lib/ui/useVaultSaver.d.ts +26 -0
  272. package/dist-lib/ui/video/VideoManager.d.ts +7 -0
  273. package/dist-lib/ui/windows/WindowManager.d.ts +452 -37
  274. package/dist-lib/ui/windows/panels/ScriptEditorPanel.d.ts +14 -0
  275. package/dist-lib/ui/windows/panels/ScriptSearch.d.ts +6 -1
  276. package/dist-lib/ui/windows/panels/TextPanel.d.ts +4 -1
  277. package/dist-lib/ui/windows/panels/VariablesView.d.ts +37 -7
  278. package/dist-lib/ui/windows/panels/WindowCmdLine.d.ts +4 -2
  279. package/dist-lib/ui/windows/panels/aliasLoop.d.ts +24 -0
  280. package/dist-lib/ui/windows/panels/editorClipboard.d.ts +45 -0
  281. package/dist-lib/ui/windows/panels/editorUndo.d.ts +79 -0
  282. package/dist-lib/ui/windows/panels/mapAreaChange.d.ts +10 -0
  283. package/dist-lib/utils/appShellCache.d.ts +25 -0
  284. package/dist-lib/utils/fontFamilyName.d.ts +13 -0
  285. package/dist-lib/utils/fontLoader.d.ts +31 -0
  286. package/dist-lib/utils/formatBytes.d.ts +4 -0
  287. package/dist-lib/utils/mustBeOneOf.d.ts +9 -0
  288. package/dist-lib/utils/profileLock.d.ts +1 -1
  289. package/dist-lib/utils/storedCredentials.d.ts +31 -0
  290. package/dist-lib/utils/systemTheme.d.ts +24 -0
  291. package/dist-lib/utils/timeZone.d.ts +10 -0
  292. package/dist-lib/vault/CredentialVault.d.ts +197 -0
  293. package/dist-lib/vault/deviceUnlock.d.ts +47 -0
  294. package/dist-lib/vault/passkeyPrf.d.ts +56 -0
  295. package/dist-lib/vault/useVault.d.ts +8 -0
  296. package/dist-lib/vault/vaultAccess.d.ts +80 -0
  297. package/dist-lib/vault/vaultCrypto.d.ts +56 -0
  298. package/dist-lib/vault/vaultHelpTopic.d.ts +9 -0
  299. package/dist-lib/vault/vaultRecord.d.ts +92 -0
  300. package/dist-lib/vfs-sw.js +220 -11
  301. package/dist-lib/vite.d.ts +1 -1
  302. package/dist-lib/vite.js +66 -43
  303. package/package.json +22 -14
  304. package/dist-lib/assets/mapParser.worker-t-3rd1zR.js +0 -9
  305. package/dist-lib/mud/connection/PingTracker.d.ts +0 -41
  306. package/dist-lib/ui/BundledGameGrid.d.ts +0 -21
  307. package/dist-lib/ui/ConnectionGrid.d.ts +0 -21
  308. package/dist-lib/ui/bufferWords.d.ts +0 -38
@@ -1,9 +1,21 @@
1
- import type { MudletArea, MudletFont, MudletMap, MudletMapHeader, MudletRoom } from 'mudlet-map-binary-reader';
1
+ import type { MudletArea, MudletColor, MudletFont, MudletLabel, MudletMap, MudletMapHeader, MudletRoom } from 'mudlet-map-binary-reader';
2
2
  import { readerExport } from 'mudlet-map-binary-reader';
3
3
  import { type ExitWeightFilter, type PathfindResult } from './pathfinding';
4
+ import { type EnvironmentKit } from './environmentKit';
5
+ import { type AreaGraphLink, type AreaGraphNode } from './areaGraph';
4
6
  export type { ExitWeightFilter, PathfindResult } from './pathfinding';
5
7
  export type MapRendererData = ReturnType<typeof readerExport>;
8
+ /** What an area with no name of its own is called — Mudlet's mUnnamedAreaName,
9
+ * which its area-name audit substitutes before checking for duplicates. */
10
+ export declare const UNNAMED_AREA_NAME = "Unnamed Area";
11
+ /** Mudlet's mDefaultAreaName — the name of area -1. */
12
+ export declare const DEFAULT_AREA_NAME = "Default Area";
13
+ /** A stock direction code (1-12) from a number or a direction name. A number
14
+ * is read the way desktop's lua_tointeger reads it, truncating toward zero,
15
+ * so `4.5` is east (4) — the same rule room ids and coordinates follow. */
6
16
  export declare function parseDirection(dir: unknown): number | undefined;
17
+ export declare const BORDER_COLOR_KEY = "room.ui_borderColor";
18
+ export declare const BORDER_THICKNESS_KEY = "room.ui_borderThickness";
7
19
  export declare const DEFAULT_FONT: MudletFont;
8
20
  export declare function makeRoom(areaId: number): MudletRoom;
9
21
  /**
@@ -21,13 +33,59 @@ export declare function makeRoom(areaId: number): MudletRoom;
21
33
  * Returns null when the payload isn't this format, so the caller can fall
22
34
  * through to the binary-model path.
23
35
  *
24
- * Room `border` is the one documented field still unmapped — no map available
25
- * to verify it against, and it needs the same post-load side-table treatment as
26
- * symbol colours. Everything else in TRoom.cpp's writeJsonRoom is covered.
27
- * Symbol colours are applied separately by applyJsonSymbolColors.
36
+ * Room borders and symbol colours have nowhere to live in the binary model, so
37
+ * applyJsonRoomBorders and applyJsonSymbolColors put them on the store once
38
+ * the rooms exist.
28
39
  */
29
- export declare function mudletJsonMapToMudletMap(src: unknown): MudletMap | null;
40
+ export declare function mudletJsonMapToMudletMap(src: unknown, droppedRoomWarnings?: string[]): MudletMap | null;
30
41
  export declare function makeArea(): MudletArea;
42
+ /**
43
+ * A map label as Mudlet Web stores it: the binary-map reader's shape plus the fields
44
+ * Mudlet's `TMapLabel` carries that the label record in its map file does not —
45
+ * the font and outline colour (which a v20 file keeps in the area's user data,
46
+ * see restoreLabelFallbacks / labelFallbackEntries) and the `temporary` flag
47
+ * (never saved). All optional, so a label read back without them stays valid.
48
+ */
49
+ export interface MapLabel extends MudletLabel {
50
+ fontName?: string;
51
+ fontSize?: number;
52
+ /** QFont weight and italic flag, carried only so a label read from a
53
+ * desktop file writes its `system.labelFont_N` back unchanged. */
54
+ fontWeight?: number;
55
+ fontItalic?: boolean;
56
+ temporary?: boolean;
57
+ outlineColor?: MudletColor;
58
+ }
59
+ /**
60
+ * The optional tail of Mudlet's `createMapLabel` — everything after the two
61
+ * colours. Defaults here are Mudlet's own (TLuaInterpreter::createMapLabel),
62
+ * not zero values: omitting them has to produce the label Mudlet would.
63
+ */
64
+ export interface MapLabelOptions {
65
+ /** Map units per rendered pixel; divides the measured text box. Default 30. */
66
+ zoom?: number;
67
+ /** Point size the text is measured at. Default 50. */
68
+ fontSize?: number;
69
+ /** Paint above rooms rather than below them. Default true. */
70
+ showOnTop?: boolean;
71
+ /** Keep a fixed on-screen size instead of scaling with the map. Default true. */
72
+ noScaling?: boolean;
73
+ /** Font family; empty/absent means the default face. */
74
+ fontName?: string;
75
+ /** Foreground (and outline) alpha, 0-255. Default 255. */
76
+ fgAlpha?: number;
77
+ /** Background alpha, 0-255. Default 50 — Mudlet's labels are mostly see-through. */
78
+ bgAlpha?: number;
79
+ /** Excluded from the map save. Default false. */
80
+ temporary?: boolean;
81
+ /** Text outline colour. Defaults to the foreground colour, which is Mudlet's
82
+ * way of saying "no outline" — it only draws one when the two differ. */
83
+ outline?: {
84
+ r: number;
85
+ g: number;
86
+ b: number;
87
+ };
88
+ }
31
89
  export interface MapLabelInfo {
32
90
  X: number;
33
91
  Y: number;
@@ -94,7 +152,7 @@ export interface MapInfoResult {
94
152
  /** A registered Mudlet `registerMapInfo` contributor.
95
153
  *
96
154
  * Two kinds exist. Script-registered ones carry a `callbackId` that indexes
97
- * into the Lua-side `__mudix_cb` registry; the LuaRuntime evaluator dispatches
155
+ * into the Lua-side `__mudlet_cb` registry; the LuaRuntime evaluator dispatches
98
156
  * to it, and they start disabled (Mudlet semantics — caller must
99
157
  * `enableMapInfo(label)` to show it). Built-in ones (`builtin: true`,
100
158
  * `callbackId: null`) mirror Mudlet's native "Short"/"Full" contributors —
@@ -116,7 +174,7 @@ export interface MapEventEntry {
116
174
  /** Label rendered in the context menu. Defaults to uniqueName when unspecified. */
117
175
  displayName: string;
118
176
  /** Extra arguments captured by addMapEvent. Mudlet's "selection" branch
119
- * (the one mudix mirrors, since the right-clicked room is treated as the
177
+ * (the one Mudlet Web mirrors, since the right-clicked room is treated as the
120
178
  * selection) discards these — kept for parity with the registration API. */
121
179
  args: unknown[];
122
180
  }
@@ -129,6 +187,25 @@ export interface MapMenuEntry {
129
187
  /** Label rendered for the submenu. Defaults to name when unspecified. */
130
188
  displayName: string;
131
189
  }
190
+ /**
191
+ * One thing wrong with the map, as {@link MapStore.auditExits} found it.
192
+ *
193
+ * Desktop's counterpart is a formatted line appended to three lists keyed by
194
+ * scope (whole map / area / room, `TMap::appendRoomErrorMsg` and friends); the
195
+ * scope is a field here so a caller can group, filter or link to the room
196
+ * rather than only print. `severity` matches the `[ WARN ]` / `[ INFO ]`
197
+ * prefixes Mudlet writes, which its console colours off.
198
+ */
199
+ export interface MapIssue {
200
+ /** `warn` for something broken, `info` for something merely surplus. */
201
+ severity: 'warn' | 'info';
202
+ /** The room the issue is about, when it is about one. */
203
+ roomId?: number;
204
+ /** The area the issue is about, when it is about one. */
205
+ areaId?: number;
206
+ /** The sentence to show, without the `[ WARN ] - ` prefix. */
207
+ message: string;
208
+ }
132
209
  export declare class MapStore {
133
210
  private rooms;
134
211
  private areas;
@@ -138,10 +215,34 @@ export declare class MapStore {
138
215
  private envColors;
139
216
  private nextRoomId;
140
217
  private nextAreaId;
218
+ /** Where TRoomDB::createNewAreaID starts looking: just past the last id it
219
+ * handed out, so a deleted area's number is not handed straight back. */
220
+ private areaIdHint;
141
221
  /** Installed by `setExitWeightFilter`; consulted per exit in findPath. */
142
222
  private exitWeightFilter;
223
+ /** TMap::mScriptCallbackDepth — how many script callbacks the map is
224
+ * inside (the exit weight filter, a map info contributor). Desktop holds
225
+ * raw room and area pointers across both, so rooms and areas may not be
226
+ * deleted, nor the map replaced, while it is above zero; Mudlet Web keeps
227
+ * the same rule so a script behaves the same on both. */
228
+ private scriptCallbackDepth;
229
+ /** TMap::mGraphBuildInProgress — the exit weight filter is being asked
230
+ * about the map's exits, and a search started from inside it is refused. */
231
+ private graphBuilding;
143
232
  private pendingBinaryHashIndex;
144
233
  private pendingBinaryHadSelection;
234
+ /** Whether the load in flight lifts the v20 `system.*` fallback keys out
235
+ * of user data. True for a binary file (and the binary-model JSON that
236
+ * toJsonString writes); false while reading Mudlet's own JSON format,
237
+ * whose reader leaves user data exactly as the file has it. */
238
+ private liftFileFallbacks;
239
+ /** TArea::mLast2DMapZoom — keyed by the area object so it follows an area
240
+ * the audit renumbers and goes when the area does. Absent means "never
241
+ * set", which reads back as the default zoom. */
242
+ private areaZooms;
243
+ /** What the last import's audit found and repaired, for whoever loaded the
244
+ * map to report. Read through {@link takeAuditIssues}. */
245
+ private lastAuditIssues;
145
246
  private version;
146
247
  private subscribers;
147
248
  private notifyPending;
@@ -175,7 +276,7 @@ export declare class MapStore {
175
276
  subscribe(cb: () => void): () => void;
176
277
  /** Subscribe to highlight-set changes only (highlightRoom / unHighlightRoom
177
278
  * and bulk clears via newEmptyMap / loadFromBinary). MudletHighlightOverlay
178
- * uses this so it re-renders without forcing a full MudixMapReader rebuild. */
279
+ * uses this so it re-renders without forcing a full MudletMapReader rebuild. */
179
280
  subscribeHighlights(cb: () => void): () => void;
180
281
  /** Subscribe to selection changes (selectMapRoom / toggleMapRoomSelection /
181
282
  * clearMapSelection and the bulk clears in newEmptyMap / loadFromBinary).
@@ -201,7 +302,7 @@ export declare class MapStore {
201
302
  * ids so subsequent {@link createRoomID} / {@link addAreaName} calls don't
202
303
  * collide. One notification fires at the end of the batch.
203
304
  */
204
- loadFromBinary(mudletMap: MudletMap): void;
305
+ loadFromBinary(mudletMap: MudletMap, audit?: boolean): void;
205
306
  /**
206
307
  * Header phase of a streamed binary load — everything in a Mudlet map
207
308
  * except the rooms (see `MudletMapReader.streamRooms`). Wipes the store and
@@ -226,7 +327,7 @@ export declare class MapStore {
226
327
  * resolve the player room, and fire the single notification the whole load
227
328
  * is worth.
228
329
  */
229
- endBinaryLoad(): void;
330
+ endBinaryLoad(audit?: boolean): void;
230
331
  /**
231
332
  * Mudlet `deleteMap()` — wipe every room, area, label and associated datum,
232
333
  * leaving a fresh empty map with a single default area (so scripts can keep
@@ -251,12 +352,54 @@ export declare class MapStore {
251
352
  */
252
353
  toJsonString(): string;
253
354
  /**
254
- * Save-side variant of {@link toMudletMap}: re-injects the v20-compatible
255
- * `system.fallback_hidden` userData key for rooms in the hidden side-table
256
- * so the serialised file round-trips back through `loadFromBinary` (and
257
- * stays loadable by Mudlet v20 readers). Render paths still call the plain
258
- * {@link toMudletMap} — the fallback key is dead weight for the renderer
259
- * and we don't want to pay the per-room object spread on every redraw.
355
+ * The map in Mudlet's OWN `saveJsonMap` schema — the exact shape
356
+ * {@link mudletJsonMapToMudletMap} reads, and the mirror of it field for
357
+ * field.
358
+ *
359
+ * Not the same thing as {@link toJsonString}, which writes the binary
360
+ * model. That was what saveJsonMap used to emit, and it round-tripped
361
+ * through this client perfectly while being unreadable to Mudlet and to
362
+ * anything reading the file itself — which the corpus does, and which is
363
+ * the point of a documented interchange format. A map exported here has to
364
+ * open in Mudlet, and one exported by Mudlet has to open here.
365
+ */
366
+ toMudletJsonString(extras?: Record<string, unknown>): string;
367
+ /**
368
+ * An area's labels in Mudlet's JSON schema (TArea::writeJsonLabels).
369
+ *
370
+ * A TEMPORARY label is left out: it belongs to the session that drew it, not
371
+ * to the map, and writing it would resurrect it on every later load.
372
+ */
373
+ private labelsToJson;
374
+ /** One room in Mudlet's JSON schema. Fields it has no value for are left
375
+ * out rather than written empty, which is what Mudlet does and what keeps
376
+ * a hand-read export legible. */
377
+ private roomToJson;
378
+ /** One exit in Mudlet's JSON schema. `key` is what the door and weight
379
+ * tables are keyed on — the SHORT name for a stock direction, the verbatim
380
+ * command for a special exit. */
381
+ private exitToJson;
382
+ /**
383
+ * Save-side variant of {@link toMudletMap}: writes what TMap::serialize
384
+ * puts into user data for a v20 file, for the fields the format has no
385
+ * slot for, so the file round-trips back through `loadFromBinary` and
386
+ * through desktop Mudlet:
387
+ *
388
+ * - room `system.fallback_hidden` for rooms in the hidden side-table;
389
+ * - room `system.fallback_symbol_color` (`QColor::name()`) for a room with
390
+ * a symbol colour;
391
+ * - room `room.ui_borderColor` (`name(HexArgb)`) / `room.ui_borderThickness`
392
+ * from the border side-tables — set when there is one, removed when not;
393
+ * - area `system.fallback_map2DZoom` for every area (the default zoom when
394
+ * none was ever set — TArea always has one);
395
+ * - area `system.labelFont_N` / `system.labelOutlineColor_N` for each
396
+ * permanent label.
397
+ *
398
+ * Temporary labels are left out, as TMap::serialize leaves them out.
399
+ * Nothing in the store is mutated: desktop leaves these keys behind in its
400
+ * in-memory user data after a save, which is not worth copying. Render paths
401
+ * still call the plain {@link toMudletMap} — none of this is any use to the
402
+ * renderer.
260
403
  */
261
404
  toMudletMapForSave(): MudletMap;
262
405
  /**
@@ -266,6 +409,59 @@ export declare class MapStore {
266
409
  * expected MudletMap shape (no `rooms` / `areas` records).
267
410
  */
268
411
  loadFromJsonString(json: string): boolean;
412
+ /** What the last repairing audit found, cleared as it is read — a report is
413
+ * owed to the load that caused it, and to no later one. */
414
+ takeAuditIssues(): MapIssue[];
415
+ /**
416
+ * Mudlet's `TMap::audit` — what runs after every map load, and what the
417
+ * Lua `auditAreas()` asks for: `TRoomDB::auditRooms` followed by
418
+ * `TRoom::audit` for every room.
419
+ *
420
+ * A map file is a document, and a document can say things the mapper API
421
+ * never could: a room or an area numbered below one, a room filed under an
422
+ * area that does not exist, an area listing rooms that are elsewhere, an
423
+ * exit to a room the file does not contain, a door on a direction with no
424
+ * way out. Every one of them is repaired the way Mudlet repairs it, and what
425
+ * was done is written into the room's (or area's) user data under the same
426
+ * `audit.*` keys, so a map that quietly changed shape can still be explained
427
+ * afterwards. The report is kept for {@link takeAuditIssues}.
428
+ */
429
+ auditMap(): MapIssue[];
430
+ /** Mudlet's mUnnamedAreaName, numbered "_001", "_002"… when it is taken. */
431
+ private freeUnnamedAreaName;
432
+ /**
433
+ * Mudlet's `TRoom::auditExits`, run over every room — the exit half of the
434
+ * audit alone, with no renumbering, plus a report on area membership.
435
+ *
436
+ * Without `repair` nothing is touched and only the report is made; with it,
437
+ * each room is repaired exactly as {@link auditMap} repairs it.
438
+ */
439
+ auditExits(repair?: boolean): MapIssue[];
440
+ /**
441
+ * One room's `TRoom::auditExits`. Each normal exit is checked in turn — an
442
+ * exit to a renumbered room follows it, one to a room that is not there
443
+ * becomes a stub, one to an id that can never exist becomes a stub too and
444
+ * sheds what a stub cannot carry — then each special exit, and finally
445
+ * whatever doors, weights, locks and custom lines are left keyed to no exit
446
+ * at all are dropped.
447
+ *
448
+ * The order matters: an exit that loses its destination BECOMES a stub, and
449
+ * only then can stub-versus-exit be judged — otherwise the stub just
450
+ * created would be dropped again by the very exit it replaced.
451
+ */
452
+ private auditRoomExits;
453
+ /**
454
+ * The area half of the report: a room filed under an area that is not
455
+ * there, and an area whose room list names a room that is not there. The
456
+ * repair is {@link auditMap}, which every load runs.
457
+ */
458
+ private auditAreaMembership;
459
+ /**
460
+ * Every profile's saved player room, ours stamped from the live
461
+ * playerRoomId so reopening the map restores the position (Mudlet's
462
+ * mRoomIdHash[mProfileName] round-trip), other profiles' preserved.
463
+ */
464
+ private playerRoomHash;
269
465
  toMudletMap(): MudletMap;
270
466
  /**
271
467
  * Mudlet `createRoomID([minimum])` — returns the smallest unused room id
@@ -287,12 +483,40 @@ export declare class MapStore {
287
483
  err: string;
288
484
  };
289
485
  deleteRoom(id: number): boolean;
486
+ /**
487
+ * Clear every exit — stock and special — that pointed at a room in `gone`.
488
+ *
489
+ * A deleted room does not take its entrances with it: the exits live on the
490
+ * rooms that lead INTO it, so removing the room alone leaves them pointing
491
+ * at a number that no longer resolves. Mudlet walks its entrance map for
492
+ * exactly this (TRoomDB::__removeRoom, then TRoom::removeAllSpecialExitsToRoom
493
+ * for the named ones), and Mudlet Web left them dangling: getRoomExits went on
494
+ * reporting a north exit to a room that had been deleted, and the mapper
495
+ * would happily route a player through it.
496
+ *
497
+ * There is no entrance index here, so this is a scan of the remaining rooms.
498
+ * Deletions are rare and the map is in memory; an index would have to be
499
+ * kept correct through every exit write to save a walk nobody waits on.
500
+ */
501
+ private severExitsTo;
502
+ /**
503
+ * TRoomDB::removeRoom resets the player's room to 0 when it removes the
504
+ * room the player is in (deleteArea goes through it room by room). Keeping
505
+ * the old id instead put the player silently back "in" whatever unrelated
506
+ * room was later created with that number (mudlet-web#343).
507
+ */
508
+ private forgetPlayerRoomIn;
290
509
  roomExists(id: number): boolean;
291
510
  /** Mudlet `getPlayerRoom()` — id of the player's current room, or null
292
511
  * when unset or the room no longer exists. Strict: no fallback room (Mudlet
293
512
  * keeps the data-layer value empty until centerview/movement sets it). The
294
513
  * view's "no known location" fallback lives in {@link getFallbackRoomId}. */
295
514
  getPlayerRoom(): number | null;
515
+ /** The player room as stored — Mudlet's `mRoomIdHash` entry, which is what
516
+ * the Lua getPlayerRoom()/gotoRoom read. Unlike {@link getPlayerRoom} it is
517
+ * not checked against the map: after the player's room is deleted it is 0,
518
+ * as on desktop, rather than unset. null only when it was never set. */
519
+ getPlayerRoomId(): number | null;
296
520
  /** Display-only fallback room for the map view when there is no real player
297
521
  * position (getPlayerRoom() is null). Mudlet's T2DMap paints the marker on
298
522
  * getRoomIDList().constFirst() — hash-arbitrary, hence its `randomRoom`
@@ -350,6 +574,22 @@ export declare class MapStore {
350
574
  getRoomEnv(id: number): number;
351
575
  setRoomEnv(id: number, env: number): boolean;
352
576
  getRoomChar(id: number): string;
577
+ /** Every distinct room symbol on the map — what a font has to be able to
578
+ * draw before it is worth choosing. */
579
+ roomSymbols(): string[];
580
+ /**
581
+ * Mudlet's "Show symbol usage…" report (`TMap::roomSymbolsHash`, consumed by
582
+ * `dlgProfilePreferences::generateMapGlyphDisplay`): every distinct room
583
+ * symbol with the rooms that carry it, commonest first.
584
+ *
585
+ * The room ids come back in full and sorted; desktop's cap of thirty-two
586
+ * per symbol is a property of its table cell, not of the data, so it is
587
+ * applied where the table is drawn.
588
+ */
589
+ roomSymbolUsage(): {
590
+ symbol: string;
591
+ rooms: number[];
592
+ }[];
353
593
  setRoomChar(id: number, char: string): boolean;
354
594
  /**
355
595
  * Mudlet `lockRoom(roomID, lockIfTrue)` — mark a room as locked so
@@ -376,10 +616,17 @@ export declare class MapStore {
376
616
  */
377
617
  setRoomWeight(id: number, weight: number): boolean;
378
618
  /** Mudlet `getRoomsByPosition(areaID, x, y, z)` — undefined for an unknown
379
- * area, matching {@link getAreaRooms}. */
619
+ * area, matching {@link getAreaRooms}. Ids come back ascending, as
620
+ * desktop's TArea::getRoomsByPosition sorts them, not in the order the
621
+ * rooms joined the area. */
380
622
  getRoomsByPosition(areaId: number, x: number, y: number, z: number): number[] | undefined;
381
623
  getRoomIDbyHash(hash: string): number | undefined;
382
- setRoomIDbyHash(id: number, hash: string): void;
624
+ /**
625
+ * Mudlet `setRoomIDbyHash(roomID, hash)`: false for a room that does not
626
+ * exist (desktop refuses it, as it does the -1 or 0 a failed lookup gives).
627
+ * An empty hash clears the room's hash rather than binding "" to it.
628
+ */
629
+ setRoomIDbyHash(id: number, hash: string): boolean;
383
630
  getRoomHashByID(id: number): string | undefined;
384
631
  /** Mudlet `getRoomExits(roomID)` — `{ direction = toRoomID }`. Undefined
385
632
  * for an unknown room (Mudlet pushes nothing at all in that case). */
@@ -403,6 +650,13 @@ export declare class MapStore {
403
650
  /** Mudlet `findPath(from, to)` — see {@link findPath} in `./pathfinding`
404
651
  * for the algorithm (A* with Mudlet's Euclidean-or-1 heuristic). */
405
652
  findPath(from: number, to: number): PathfindResult | null;
653
+ /** TMap::scriptCallbackInProgress — inside the exit weight filter or a map
654
+ * info contributor, where rooms and areas may not be deleted nor the map
655
+ * replaced (see {@link scriptCallbackDepth}). */
656
+ scriptCallbackInProgress(): boolean;
657
+ /** TMap::graphBuildInProgress — inside the exit weight filter, where no
658
+ * path may be searched for. */
659
+ graphBuildInProgress(): boolean;
406
660
  /** Mudlet `setExitWeightFilter(fn|nil)` — the callback consulted for every
407
661
  * candidate exit during pathfinding, or null when none is installed. Set
408
662
  * by the Lua binding; read only by {@link findPath}. */
@@ -432,13 +686,41 @@ export declare class MapStore {
432
686
  /** Mudlet `removeSpecialExit(exitRoomID, command)` — see {@link addSpecialExit}
433
687
  * for the message/null return shape. */
434
688
  removeSpecialExit(from: number, cmd: string): string | null;
689
+ /**
690
+ * Drop everything keyed by a special exit's command once the exit itself is
691
+ * gone: its door, its lock, its weight, its custom line. Mudlet does this
692
+ * in every path that removes one (TRoom::setSpecialExit(-1, cmd) drops the
693
+ * custom line; removeAllSpecialExitsToRoom cleans up "related elements
694
+ * first"), and leaving them behind is not inert — the command name is the
695
+ * key, so re-adding the same exit later found a door, a lock and a line it
696
+ * never asked for, and the room stayed unwalkable for reasons nothing showed.
697
+ */
698
+ private clearSpecialExitAttributes;
699
+ /**
700
+ * The stock-exit twin of {@link clearSpecialExitAttributes}: an exit that
701
+ * is cleared (setExit to a room below one, or the room it led to deleted)
702
+ * takes its door, lock, weight and custom line with it, as TRoom::setExit
703
+ * and TRoomDB::__removeRoom do — otherwise an exit made there again starts
704
+ * out locked behind a door with a weight nothing shows.
705
+ */
706
+ private clearStockExitAttributes;
707
+ /**
708
+ * Mudlet's TRoom::hasExitOrSpecialExit(QString): whether `key` still names
709
+ * an exit of the room — a normal one by its short direction ("n", "up"…),
710
+ * or a special one by its command. A special exit named like a normal one
711
+ * shares that exit's weight, so removing the special exit must leave the
712
+ * weight while the normal exit is still there.
713
+ */
714
+ private hasExitOrSpecialExitNamed;
435
715
  getSpecialExitsSwap(id: number): Record<string, number>;
436
716
  /**
437
717
  * Mudlet `getSpecialExits(roomID [, listAllExits])` — special exits keyed by
438
718
  * destination room id: `{ [exitRoomID] = { [command] = "0"|"1" } }`, where
439
719
  * "1" marks a locked exit. When several commands lead to the same room and
440
720
  * `listAllExits` is false (the default), only the lowest-weight command is
441
- * reported; pass `true` to list every command. Returns `{}` for a missing
721
+ * reported — among equally weighted ones the alphabetically LAST, since
722
+ * desktop walks them in QMap (key) order and keeps a later tie (`<=`); pass
723
+ * `true` to list every command. Returns `{}` for a missing
442
724
  * room. The lock flag follows this client's data model (special-exit locks
443
725
  * are tracked by destination room id, see pathfinding.ts).
444
726
  */
@@ -502,6 +784,7 @@ export declare class MapStore {
502
784
  /**
503
785
  * Mudlet `getAllRoomEntrances(roomID)` — every room that has an exit (stock
504
786
  * or special) leading into this room, as a sorted, de-duplicated id list.
787
+ * A room with an exit back into itself lists itself, as on desktop.
505
788
  * Returns `undefined` when the room doesn't exist.
506
789
  */
507
790
  getAllRoomEntrances(id: number): number[] | undefined;
@@ -529,9 +812,8 @@ export declare class MapStore {
529
812
  * Mudlet `getCustomLines(roomID)` — per-direction custom exit lines drawn
530
813
  * on the map. Returns `undefined` when the room doesn't exist so the Lua
531
814
  * wrapper can hand back `nil`; otherwise a `{ dir = { attributes, points } }`
532
- * table (empty when the room has no custom lines). Points carry the room's
533
- * Z because Mudlet stores only X/Y per point and uses the owning room's Z
534
- * for rendering.
815
+ * table (empty when the room has no custom lines). Points are X/Y only, as
816
+ * Mudlet stores and reports them — a line lies on its owning room's Z.
535
817
  */
536
818
  getCustomLines(id: number): Record<string, {
537
819
  attributes: {
@@ -546,17 +828,17 @@ export declare class MapStore {
546
828
  points: Array<{
547
829
  x: number;
548
830
  y: number;
549
- z: number;
550
831
  }>;
551
832
  }> | undefined;
552
833
  /**
553
834
  * Mudlet `removeCustomLine(roomID, direction)` — drop the custom exit line
554
835
  * for a direction (stock direction number/name or a special-exit command).
555
836
  * The key form stored varies by map source, so we try the raw command, the
556
- * canonical long name and the short name. Returns true when a line was
557
- * removed, false when the room or the line doesn't exist.
837
+ * canonical long name and the short name. Like desktop, every refusal — no
838
+ * such room, no exit in that direction, no line on it — is a message (the
839
+ * Lua side's `nil, errMsg`); null means the line was removed.
558
840
  */
559
- removeCustomLine(id: number, dir: number | string): boolean;
841
+ removeCustomLine(id: number, dir: number | string): string | null;
560
842
  /**
561
843
  * Mudlet `addCustomLine(roomID, id_to, direction, style, color, arrow)`.
562
844
  * `target` is either a destination room id (line drawn to that room's
@@ -587,12 +869,18 @@ export declare class MapStore {
587
869
  * "up"/"down"/"in"/"out"), which is also what a saved map carries — or an
588
870
  * arbitrary special-exit command string, used as-is.
589
871
  *
872
+ * Only those twelve exact, lower-case spellings name a stock exit: desktop
873
+ * compares the command against them verbatim (TLuaInterpreter::setDoor),
874
+ * so "east", "E" or "4" are special-exit names and are refused unless the
875
+ * room has a special exit called that — they never touch the stock door.
876
+ *
590
877
  * Mudlet refuses a direction the room has no exit *or stub* for, and a
591
878
  * status outside 0-3; both are `(nil, errMsg)` returns rather than a bare
592
- * false, so the failure is reported here as the message string and success
593
- * as null (same shape as {@link addCustomLine}).
879
+ * false, so the failure is reported here as the message string. Otherwise
880
+ * the answer is TRoom::setDoor's: true when the door changed, false when it
881
+ * already had that status.
594
882
  */
595
- setDoor(id: number, dir: number | string, val: number): string | null;
883
+ setDoor(id: number, cmd: string, val: number): string | boolean;
596
884
  /**
597
885
  * Mudlet `getRoomUserData(id, key)` — returns the stored value, or
598
886
  * `undefined` when either the room or the key is missing. The Lua binding
@@ -651,6 +939,22 @@ export declare class MapStore {
651
939
  clearMapUserDataItem(key: string): boolean;
652
940
  getAllMapUserData(): Record<string, string>;
653
941
  /** Replace the entire map-level user-data dict (e.g. after loading a .dat). */
942
+ /** The areas as a graph with a world layout — see map/areaGraph.ts. It
943
+ * reads the map through this source, and keeps its layout in the map's
944
+ * user data, so a map replaced under it is noticed on the next read. */
945
+ private readonly areaGraph;
946
+ private areaGraphRoom;
947
+ /** Mudlet getAreaGraph(): the areas, by id in ascending order, and the
948
+ * links between them sorted by (from, to). */
949
+ getAreaGraph(): {
950
+ areas: AreaGraphNode[];
951
+ links: AreaGraphLink[];
952
+ };
953
+ /** Mudlet setAreaGraphPosition(areaID, x, y): pins the area there. False
954
+ * for an area the graph does not have, or a coordinate out of range. */
955
+ setAreaGraphPosition(areaId: number, x: number, y: number): boolean;
956
+ /** Mudlet resetAreaGraphLayout([keepPinned]). */
957
+ resetAreaGraphLayout(keepPinned: boolean): void;
654
958
  loadMapUserData(data: Record<string, string> | undefined | null): void;
655
959
  /**
656
960
  * Mudlet `addAreaName(name)` returns a numeric area ID on success or
@@ -715,8 +1019,9 @@ export declare class MapStore {
715
1019
  */
716
1020
  searchAreaUserData(key?: string, value?: string): string[] | number[];
717
1021
  /**
718
- * Per-area 2D-map zoom stored in the map file (area userData under
719
- * {@link AREA_ZOOM_KEY}), in Mudlet units. Returns `undefined` when the area
1022
+ * Per-area 2D-map zoom (TArea::mLast2DMapZoom), in Mudlet units — written
1023
+ * to the file under {@link AREA_ZOOM_KEY} and lifted back out of the area's
1024
+ * user data on load, so scripts never see the key. Returns `undefined` when the area
720
1025
  * is missing or has no usable saved zoom, in which case the caller opens at
721
1026
  * {@link DEFAULT_MAP_ZOOM}. Mirrors Mudlet's treatment of zoom as map data
722
1027
  * rather than client config.
@@ -728,8 +1033,8 @@ export declare class MapStore {
728
1033
  */
729
1034
  getAreaZoom(id: number): number | undefined;
730
1035
  /**
731
- * Save the per-area zoom into the area's userData so it round-trips with the
732
- * map file. Deliberately does NOT call {@link notify} — zoom is a view-only
1036
+ * Set the per-area zoom; it round-trips with the map file (see
1037
+ * {@link getAreaZoom}). Deliberately does NOT call {@link notify} — zoom is a view-only
733
1038
  * datum that no renderer reads from the store snapshot, and the camera-move
734
1039
  * handler calls this on every wheel tick; notifying would rebuild the whole
735
1040
  * scene on each one. The value persists to IndexedDB the next time the map is
@@ -798,6 +1103,14 @@ export declare class MapStore {
798
1103
  */
799
1104
  getAreaExits(areaId: number, fullData?: boolean): number[] | Record<number, Record<string, number>> | undefined;
800
1105
  getRooms(): Record<number, string>;
1106
+ /**
1107
+ * Every room's id and name in the order the room map is walked — the order
1108
+ * {@link getHiddenRooms} lists them in too. `getRooms()` builds its Lua
1109
+ * table in this order rather than from an object, whose integer keys come
1110
+ * back sorted: what `#` makes of a table with holes depends on the order
1111
+ * its keys went in.
1112
+ */
1113
+ getRoomNamesInOrder(): Array<[number, string]>;
801
1114
  /**
802
1115
  * Mudlet `getMapLabels(areaID)` — returns `{ [labelID] = labelText }` for
803
1116
  * every label in the area, or an empty object if the area has none / is
@@ -818,39 +1131,53 @@ export declare class MapStore {
818
1131
  * Bridge.lua dispatches the sentinels into Mudlet's `(false, errMsg)` shape.
819
1132
  */
820
1133
  getMapLabel(areaId: number, key: number | string): MapLabelLookup;
821
- /** Next free label id within an area — Mudlet keys labels by an integer that
822
- * is unique per area and starts at 0. */
1134
+ /** Lowest free label id within an area — Mudlet keys labels by an integer
1135
+ * that is unique per area, and TArea::createLabelId counts up from 0 to the
1136
+ * first one not taken, so a deleted label's id is handed out again. */
823
1137
  private nextLabelId;
824
1138
  /**
825
1139
  * Mudlet `createMapLabel(areaID, text, posx, posy, posz, fgRed, fgGreen,
826
1140
  * fgBlue, bgRed, bgGreen, bgBlue [, zoom [, fontSize [, showOnTop [,
827
- * noScaling]]]])`. Adds a text label to the area and returns its new id, or
828
- * -1 if the area does not exist. (`zoom`/`fontSize` are accepted for
829
- * signature parity — mudix stores labels but the renderer does not yet draw
830
- * them, mirroring how labels loaded from binary maps are kept and queried
831
- * but not painted.)
1141
+ * noScaling [, fontName [, foregroundTransparency [, backgroundTransparency
1142
+ * [, temporary [, outlineRed, outlineGreen, outlineBlue]]]]]]]]])`. Adds a
1143
+ * text label to the area and returns its new id, or -1 if the area does not
1144
+ * exist or the text is empty (both are Mudlet's own refusals).
1145
+ *
1146
+ * `fontName`, `temporary` and the outline colour are extra fields on the
1147
+ * stored label (see `MapLabel`); of the three only `temporary` is visible
1148
+ * from Lua, because Mudlet's getMapLabel doesn't publish the other two
1149
+ * either. The label's image is rendered here, as desktop renders it, so a
1150
+ * saved map carries it (see renderLabelPixmap).
832
1151
  */
833
- createMapLabel(areaId: number, text: string, x: number, y: number, z: number, fgR: number, fgG: number, fgB: number, bgR: number, bgG: number, bgB: number, fontSize?: number, showOnTop?: boolean, noScaling?: boolean): number;
1152
+ createMapLabel(areaId: number, text: string, x: number, y: number, z: number, fgR: number, fgG: number, fgB: number, bgR: number, bgG: number, bgB: number, opts?: MapLabelOptions): number;
834
1153
  /**
835
1154
  * Mudlet `createMapImageLabel(areaID, imagePathFileName, posx, posy, posz,
836
- * width, height, zoom [, showOnTop [, noScaling]])`. Adds an image label and
837
- * returns its new id, or -1 if the area is missing. The image reference is
838
- * stored verbatim in the label's `pixMap` (surfaced as `Pixmap` by
839
- * getMapLabel); like text labels it is not yet painted by the renderer.
840
- */
841
- createMapImageLabel(areaId: number, imagePath: string, x: number, y: number, z: number, width: number, height: number, showOnTop?: boolean, noScaling?: boolean): number;
1155
+ * width, height, zoom, showOnTop [, temporary])`. Adds an image label and
1156
+ * returns its new id, or -1 if the area is missing. `pixmap` is the image
1157
+ * itself as a base64 PNG — desktop reads the file at creation and keeps only
1158
+ * the picture, so getMapLabel's `Pixmap`, the map file and saveJsonMap all
1159
+ * carry image data, never the path (the Lua binding reads the file). Like
1160
+ * TMap::createMapImageLabel, the colours are TMapLabel's untouched opaque
1161
+ * black and the label always scales with the map.
1162
+ */
1163
+ createMapImageLabel(areaId: number, pixmap: string, x: number, y: number, z: number, width: number, height: number, showOnTop?: boolean, temporary?: boolean): number;
1164
+ /**
1165
+ * Replace a label's pixmap, but only while it still holds `expected` — the
1166
+ * swap an image label's asynchronously drawn pixmap makes, which must not
1167
+ * land on a label deleted, recreated or reloaded in the meantime. Returns
1168
+ * whether it replaced anything.
1169
+ */
1170
+ replaceLabelPixmap(areaId: number, labelId: number, expected: string, pixmap: string): boolean;
842
1171
  /** Mudlet `deleteMapLabel(areaID, labelID)`. Removes the label; returns
843
1172
  * false when the area or label id does not exist. */
844
1173
  deleteMapLabel(areaId: number, labelId: number): boolean;
845
1174
  /**
846
- * Mudlet `auditAreas()` — sweep the map for area/room consistency problems
847
- * and repair what is safe to repair. mudix rebuilds every area's membership
848
- * list (`rooms[]`) from the authoritative `room.area` back-pointers, which
849
- * drops dangling room ids and re-files rooms that were missing from their
850
- * area's list. Rooms whose `area` points at a non-existent area are reported
851
- * but left untouched (they may be intentionally parked in the void area -1).
852
- * Returns a summary report (Mudlet returns nothing; mudix surfaces the audit
853
- * so scripts can act on it).
1175
+ * Mudlet `auditAreas()` — which is `TMap::audit`, the same audit every map
1176
+ * load runs (see {@link auditMap}): room and area ids below one renumbered,
1177
+ * areas the rooms or the area names call for created, every area's room
1178
+ * list rebuilt from the rooms' own `area`, and every room's exits checked.
1179
+ * Mudlet returns nothing; Mudlet Web also returns a summary of what the area
1180
+ * half found, taken before the repair, so a script can act on it.
854
1181
  */
855
1182
  auditAreas(): {
856
1183
  checkedAreas: number;
@@ -863,11 +1190,24 @@ export declare class MapStore {
863
1190
  addMapEvent(uniqueName: string, eventName: string, parent?: string | null, displayName?: string | null, ...args: unknown[]): boolean;
864
1191
  removeMapEvent(uniqueName: string): boolean;
865
1192
  getMapEvents(): MapEventEntry[];
1193
+ /** The built-in context-menu items hideMapMenuItem() takes, by desktop's
1194
+ * names (TMap::builtInMenuItemNames). They are API, so never rename one —
1195
+ * most have no counterpart in this client's menu, but scripts still pass
1196
+ * them, and desktop accepts every one. */
1197
+ static readonly BUILTIN_MENU_ITEMS: readonly string[];
1198
+ private hiddenMenuItems;
1199
+ /** Hide (or show again) a built-in item. False for a name that is not one. */
1200
+ setMenuItemHidden(name: string, hidden: boolean): boolean;
1201
+ menuItemShown(name: string): boolean;
1202
+ /** The hidden items, sorted as desktop lists them. */
1203
+ getHiddenMenuItems(): string[];
866
1204
  /** Mudlet `addMapMenu(menuName [, parent [, displayName]])`. Registers a
867
1205
  * submenu in the map's right-click context menu that addMapEvent entries
868
1206
  * can nest under via their `parent`. Re-registering the same name replaces
869
1207
  * the prior entry. */
870
1208
  addMapMenu(name: string, parent?: string | null, displayName?: string | null): boolean;
1209
+ /** True when anything went: the menu itself, or a submenu or event filed
1210
+ * under it (desktop sweeps those even for a parent never added). */
871
1211
  removeMapMenu(name: string): boolean;
872
1212
  getMapMenus(): MapMenuEntry[];
873
1213
  private roomBorderColors;
@@ -928,7 +1268,7 @@ export declare class MapStore {
928
1268
  * unhooked). Empty when no enabled contributor returned a non-empty text. */
929
1269
  evaluateMapInfos(roomId: number | null, selectionSize: number, areaId: number, displayedAreaId: number): MapInfoResult[];
930
1270
  /** Drop every script-registered contributor. Called on LuaRuntime teardown
931
- * — the callback IDs index into the dying runtime's __mudix_cb registry.
1271
+ * — the callback IDs index into the dying runtime's __mudlet_cb registry.
932
1272
  * Built-in contributors are native (no Lua dependency) so they survive,
933
1273
  * keeping the default "Short"/"Full" overlays available across reconnects
934
1274
  * and script reloads. */
@@ -956,6 +1296,16 @@ export declare class MapStore {
956
1296
  * paints rooms with that env using these RGB values. spec=1 (RGB) is the
957
1297
  * Qt QColor::Rgb spec, matching what the binary reader emits. */
958
1298
  setCustomEnvColor(envId: number, r: number, g: number, b: number, a?: number): void;
1299
+ /**
1300
+ * The sixteen mapper colours as the profile holds them, outliving any map
1301
+ * loaded into this store.
1302
+ *
1303
+ * They outlive the SESSION in Mudlet, being profile data; here they do not
1304
+ * yet — nothing writes them to the profile bag, so reopening a profile
1305
+ * brings back the Qt defaults. Closing that needs a settings field of its
1306
+ * own, which is a change to the stored schema rather than to the map.
1307
+ */
1308
+ private readonly profileEnvColors;
959
1309
  /**
960
1310
  * Seed env IDs 257-272 with the profile's 16 mapper colours, mirroring
961
1311
  * TMap::restore16ColorSet. Mudlet keeps that block permanently present in
@@ -981,12 +1331,31 @@ export declare class MapStore {
981
1331
  * falls back to the built-in env palette. Returns true if an entry was
982
1332
  * removed. */
983
1333
  removeCustomEnvColor(envId: number): boolean;
1334
+ /**
1335
+ * The colour desktop draws an environment's rooms in
1336
+ * (RoomAppearance::environmentColor): mEnvColors remaps the id first; 1-16
1337
+ * are the profile's sixteen mapper colours; a custom colour wins over the
1338
+ * xterm cube and grey ramp for 17-255; and anything left — an environment
1339
+ * the map does not define, or one remapped onto nothing — is dark red, the
1340
+ * colour of environment 1, so that no room is drawn invisible.
1341
+ */
1342
+ environmentColor(environmentId: number): [number, number, number];
1343
+ /** Mudlet getMapEnvironmentKit(envID) → the kit, and whether the map names
1344
+ * it rather than it being guessed from the environment's colour — which is
1345
+ * read afresh each time, so the guess follows the colour. */
1346
+ getEnvironmentKit(environmentId: number): [EnvironmentKit, boolean];
1347
+ /** Mudlet getMapEnvironmentKits() → the kits the map names, by environment. */
1348
+ getEnvironmentKits(): Map<number, EnvironmentKit>;
1349
+ /** Mudlet setMapEnvironmentKit(envID, kit) — null clears. False when the
1350
+ * saved kits are not a JSON object, which is then left alone. */
1351
+ setEnvironmentKit(environmentId: number, kit: EnvironmentKit | null): boolean;
984
1352
  private mapMode;
985
1353
  private mapModeListener;
986
1354
  setMapModeListener(fn: ((mode: 'viewing' | 'editing') => void) | null): void;
987
1355
  getMapMode(): 'viewing' | 'editing';
988
1356
  setMapMode(mode: 'viewing' | 'editing'): boolean;
989
1357
  private roomCharColors;
1358
+ private unsetCharColorRooms;
990
1359
  private hiddenRooms;
991
1360
  private hiddenVersion;
992
1361
  setRoomCharColor(id: number, r: number, g: number, b: number, a?: number): boolean;
@@ -1003,6 +1372,9 @@ export declare class MapStore {
1003
1372
  * own semantics).
1004
1373
  */
1005
1374
  unsetRoomCharColor(id: number): boolean;
1375
+ /** Whether unsetRoomCharColor cleared this room's colour (and nothing has
1376
+ * set one since). */
1377
+ isRoomCharColorUnset(id: number): boolean;
1006
1378
  /**
1007
1379
  * Mudlet `setRoomHidden(roomID, hidden)`. Toggles the hidden flag; the
1008
1380
  * RoomLens installed on the renderer consults {@link isRoomHidden} when
@@ -1028,7 +1400,7 @@ export declare class MapStore {
1028
1400
  /**
1029
1401
  * Mudlet `getHiddenRooms()` — the hidden rooms of the whole map. Mudlet
1030
1402
  * takes no argument at all (TLuaInterpreter::getHiddenRooms walks the
1031
- * entire room map); mudix additionally accepts an areaID to scope the
1403
+ * entire room map); Mudlet Web additionally accepts an areaID to scope the
1032
1404
  * answer, in which case `undefined` distinguishes "no such area" from "no
1033
1405
  * hidden rooms here".
1034
1406
  */
@@ -1041,7 +1413,8 @@ export declare class MapStore {
1041
1413
  * if the room does not exist.
1042
1414
  */
1043
1415
  highlightRoom(id: number, r1: number, g1: number, b1: number, r2: number, g2: number, b2: number, radius: number, a1?: number, a2?: number): boolean;
1044
- /** Mudlet unHighlightRoom(roomID). Returns false when the room had no highlight. */
1416
+ /** Mudlet unHighlightRoom(roomID). False only for a room that doesn't
1417
+ * exist; a room with no highlight to remove is still true, as on desktop. */
1045
1418
  unHighlightRoom(id: number): boolean;
1046
1419
  /** Snapshot of all active room highlights. MapPanel reads this each store
1047
1420
  * notify to reconcile the renderer's overlay shapes against the store. */