@mudlet/mudlet-web 0.5.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist-lib/analytics.d.ts +27 -0
- package/dist-lib/assets/fonts/Vera.woff2 +0 -0
- package/dist-lib/assets/fonts/VeraBI.woff2 +0 -0
- package/dist-lib/assets/fonts/VeraBd.woff2 +0 -0
- package/dist-lib/assets/fonts/VeraIt.woff2 +0 -0
- package/dist-lib/assets/mapParser.worker-DrVZ3wg_.js +9 -0
- package/dist-lib/backupImport-wt8r7JXI.js +233 -0
- package/dist-lib/branding.d.ts +111 -13
- package/dist-lib/db/sqliteClient.d.ts +195 -7
- package/dist-lib/hooks/useAutoReconnect.d.ts +61 -0
- package/dist-lib/hooks/useDocumentFullscreen.d.ts +23 -0
- package/dist-lib/hooks/useKeyboardShortcuts.d.ts +37 -0
- package/dist-lib/hooks/useRecordLastPlayed.d.ts +10 -0
- package/dist-lib/import/applyMudletProfile.d.ts +35 -9
- package/dist-lib/import/backupImport.d.ts +118 -0
- package/dist-lib/import/collectProfileExport.d.ts +33 -2
- package/dist-lib/import/defaultPackages.d.ts +57 -14
- package/dist-lib/import/defaults/CF-loader/CF-loader.mpackage +0 -0
- package/dist-lib/import/defaults/MedBootstrap/MedBootstrap.mpackage +0 -0
- package/dist-lib/import/defaults/deleteOldProfiles/deleteOldProfiles.mpackage +0 -0
- package/dist-lib/import/defaults/echo/echo.mpackage +0 -0
- package/dist-lib/import/defaults/enable-accessibility/enable-accessibility.mpackage +0 -0
- package/dist-lib/import/defaults/generic_mapper/generic_mapper.mpackage +0 -0
- package/dist-lib/import/defaults/gui-drop/gui-drop.mpackage +0 -0
- package/dist-lib/import/defaults/icesus-loader/icesus-loader.mpackage +0 -0
- package/dist-lib/import/defaults/mg-loader/mg-loader.mpackage +0 -0
- package/dist-lib/import/defaults/mudlet-base-ui/mudlet-base-ui.mpackage +0 -0
- package/dist-lib/import/defaults/mudlet-mapper.xml +1215 -389
- package/dist-lib/import/mudletControlChars.d.ts +14 -0
- package/dist-lib/import/mudletHost.d.ts +73 -10
- package/dist-lib/import/mudletLink.d.ts +53 -2
- package/dist-lib/import/mudletProfileExport.d.ts +38 -5
- package/dist-lib/import/mudletProfileImport.d.ts +110 -12
- package/dist-lib/import/mudletVariables.d.ts +4 -3
- package/dist-lib/import/mudletWriteback.d.ts +15 -1
- package/dist-lib/import/mudletXmlImport.d.ts +46 -0
- package/dist-lib/import/packageFonts.d.ts +33 -0
- package/dist-lib/import/packageInstaller.d.ts +111 -7
- package/dist-lib/import/qtProfileData.d.ts +10 -0
- package/dist-lib/import/remotePackageInstall.d.ts +23 -7
- package/dist-lib/import/zipEntries.d.ts +45 -0
- package/dist-lib/index.d.ts +7 -3
- package/dist-lib/index.js +50508 -29836
- package/dist-lib/logging/SessionLogger.d.ts +75 -15
- package/dist-lib/map/MapSelectionOverlay.d.ts +2 -2
- package/dist-lib/map/MapStore.d.ts +387 -60
- package/dist-lib/map/MudletHighlightOverlay.d.ts +2 -2
- package/dist-lib/map/{MudixMapReader.d.ts → MudletMapReader.d.ts} +2 -2
- package/dist-lib/map/areaGraph.d.ts +120 -0
- package/dist-lib/map/environmentKit.d.ts +36 -0
- package/dist-lib/map/labelPixmap.d.ts +90 -0
- package/dist-lib/map/mapImageExport.d.ts +36 -2
- package/dist-lib/map/mapStyle.d.ts +11 -0
- package/dist-lib/map/mapVersion.d.ts +66 -0
- package/dist-lib/map/pathfinding.d.ts +2 -2
- package/dist-lib/mud/CharLoginController.d.ts +230 -0
- package/dist-lib/mud/ItemIdSequence.d.ts +1 -1
- package/dist-lib/mud/MudSession.d.ts +279 -22
- package/dist-lib/mud/PatternEngine.d.ts +153 -14
- package/dist-lib/mud/aliases/AliasEngine.d.ts +55 -9
- package/dist-lib/mud/autoLogin.d.ts +59 -0
- package/dist-lib/mud/commandSplit.d.ts +9 -0
- package/dist-lib/mud/connection/LineAssembler.d.ts +38 -11
- package/dist-lib/mud/connection/MudClient.d.ts +291 -53
- package/dist-lib/mud/connection/SubnegotiationRepair.d.ts +24 -0
- package/dist-lib/mud/connection/TelnetNegotiator.d.ts +208 -68
- package/dist-lib/mud/connection/telnetDebug.d.ts +8 -8
- package/dist-lib/mud/events.d.ts +102 -23
- package/dist-lib/mud/games/bundledGames.d.ts +12 -7
- package/dist-lib/mud/games/gameLinks.d.ts +40 -0
- package/dist-lib/mud/games/icons/3Kingdoms.png +0 -0
- package/dist-lib/mud/games/icons/3Scapes.png +0 -0
- package/dist-lib/mud/games/icons/achaea.png +0 -0
- package/dist-lib/mud/games/icons/aetolia.png +0 -0
- package/dist-lib/mud/games/icons/banner_astaria.png +0 -0
- package/dist-lib/mud/games/icons/banner_darkmists.png +0 -0
- package/dist-lib/mud/games/icons/banner_dreamland.png +0 -0
- package/dist-lib/mud/games/icons/banner_petria.jpg +0 -0
- package/dist-lib/mud/games/icons/banner_ropmud.png +0 -0
- package/dist-lib/mud/games/icons/blackmud.png +0 -0
- package/dist-lib/mud/games/icons/carrionfields.png +0 -0
- package/dist-lib/mud/games/icons/dragonfire_icon.png +0 -0
- package/dist-lib/mud/games/icons/fed2-logo.png +0 -0
- package/dist-lib/mud/games/icons/icesus_480x120.png +0 -0
- package/dist-lib/mud/games/icons/imperian.png +0 -0
- package/dist-lib/mud/games/icons/infinity_480x120.png +0 -0
- package/dist-lib/mud/games/icons/lusternia.png +0 -0
- package/dist-lib/mud/games/icons/morgengrauen_480x120.png +0 -0
- package/dist-lib/mud/games/icons/mudlet-tutorial.png +0 -0
- package/dist-lib/mud/games/icons/phoenixmud_480x120.png +0 -0
- package/dist-lib/mud/games/icons/starmourn.png +0 -0
- package/dist-lib/mud/games/icons/voidmud_icon.png +0 -0
- package/dist-lib/mud/games/icons/wotmudicon.png +0 -0
- package/dist-lib/mud/games/websiteLinks.d.ts +21 -0
- package/dist-lib/mud/keybindings/KeyEngine.d.ts +110 -4
- package/dist-lib/mud/keybindings/browserReservedKeys.d.ts +2 -2
- package/dist-lib/mud/keybindings/keyEventTarget.d.ts +61 -0
- package/dist-lib/mud/keybindings/qtKeys.d.ts +91 -12
- package/dist-lib/mud/protocol/atcp.d.ts +19 -0
- package/dist-lib/mud/protocol/byteString.d.ts +24 -0
- package/dist-lib/mud/protocol/charLoginFlow.d.ts +243 -16
- package/dist-lib/mud/protocol/charset.d.ts +111 -46
- package/dist-lib/mud/protocol/codePages.d.ts +10 -0
- package/dist-lib/mud/protocol/constants.d.ts +17 -10
- package/dist-lib/mud/protocol/echo.d.ts +23 -27
- package/dist-lib/mud/protocol/gmcp.d.ts +36 -6
- package/dist-lib/mud/protocol/index.d.ts +3 -2
- package/dist-lib/mud/protocol/luaLiteral.d.ts +12 -0
- package/dist-lib/mud/protocol/mccp.d.ts +83 -1
- package/dist-lib/mud/protocol/mnes.d.ts +41 -58
- package/dist-lib/mud/protocol/msdp.d.ts +11 -4
- package/dist-lib/mud/protocol/msp.d.ts +3 -2
- package/dist-lib/mud/protocol/mssp.d.ts +9 -4
- package/dist-lib/mud/protocol/multiByte.d.ts +51 -0
- package/dist-lib/mud/protocol/multiByteEncode.d.ts +42 -0
- package/dist-lib/mud/protocol/mxp.d.ts +193 -14
- package/dist-lib/mud/protocol/oauthClientFlow.d.ts +128 -0
- package/dist-lib/mud/protocol/qtCodePages.generated.d.ts +1 -0
- package/dist-lib/mud/protocol/tlsCodes.d.ts +40 -3
- package/dist-lib/mud/replay/ReplayPlayer.d.ts +16 -1
- package/dist-lib/mud/replay/replayFormat.d.ts +29 -2
- package/dist-lib/mud/text/Console.d.ts +255 -49
- package/dist-lib/mud/text/FormatState.d.ts +137 -14
- package/dist-lib/mud/text/ansiEscapes.d.ts +32 -16
- package/dist-lib/mud/text/colorParsers.d.ts +14 -2
- package/dist-lib/mud/text/colorSpaceId.d.ts +2 -0
- package/dist-lib/mud/text/colors.d.ts +17 -10
- package/dist-lib/mud/text/controlCharacterMode.d.ts +1 -1
- package/dist-lib/mud/text/hyperlinkVisibility.d.ts +1 -1
- package/dist-lib/mud/text/lineBreak.d.ts +5 -0
- package/dist-lib/mud/text/serverWrap.d.ts +2 -2
- package/dist-lib/mud/text/textAnalyzer.d.ts +79 -0
- package/dist-lib/mud/text/unicodeRuns.d.ts +11 -0
- package/dist-lib/mud/text/unicodeTables.generated.d.ts +3 -0
- package/dist-lib/mud/text/wcwidth.d.ts +27 -22
- package/dist-lib/mud/timers/TimerEngine.d.ts +163 -11
- package/dist-lib/mud/timers/workerClock.d.ts +67 -0
- package/dist-lib/mud/triggers/TriggerEngine.d.ts +449 -47
- package/dist-lib/mud/triggers/legacyColorPatterns.d.ts +58 -0
- package/dist-lib/mud/triggers/pcre/Pcre2.d.ts +83 -1
- package/dist-lib/oauth-callback.html +94 -0
- package/dist-lib/pcre2Wasm.d.ts +54 -0
- package/dist-lib/pcre2Wasm.js +241 -0
- package/dist-lib/scripting/EngineHost.d.ts +45 -21
- package/dist-lib/scripting/IScriptingRuntime.d.ts +103 -27
- package/dist-lib/scripting/MxpFrameManager.d.ts +10 -1
- package/dist-lib/scripting/ScriptingAPI.d.ts +1030 -213
- package/dist-lib/scripting/ScriptingEngine.d.ts +727 -106
- package/dist-lib/scripting/StopwatchManager.d.ts +97 -36
- package/dist-lib/scripting/http/HttpService.d.ts +9 -1
- package/dist-lib/scripting/http/userUrl.d.ts +41 -0
- package/dist-lib/scripting/lua/LuaRuntime.d.ts +352 -77
- package/dist-lib/scripting/lua/argContracts.d.ts +71 -0
- package/dist-lib/scripting/lua/bindings/automation.d.ts +1 -1
- package/dist-lib/scripting/lua/bindings/commands.d.ts +13 -0
- package/dist-lib/scripting/lua/bindings/context.d.ts +20 -2
- package/dist-lib/scripting/lua/bindings/diagnostics.d.ts +1 -1
- package/dist-lib/scripting/lua/bindings/map.d.ts +1 -1
- package/dist-lib/scripting/lua/bindings/media.d.ts +2 -2
- package/dist-lib/scripting/lua/bindings/output.d.ts +1 -1
- package/dist-lib/scripting/lua/bindings/session.d.ts +2 -2
- package/dist-lib/scripting/lua/bindings/textEdit.d.ts +1 -1
- package/dist-lib/scripting/lua/bindings/userWindows.d.ts +1 -1
- package/dist-lib/scripting/lua/byteArmor.d.ts +36 -0
- package/dist-lib/scripting/lua/imageSize.d.ts +7 -0
- package/dist-lib/scripting/lua/rex.d.ts +4 -2
- package/dist-lib/scripting/lua/sqlRowEncoder.d.ts +6 -1
- package/dist-lib/scripting/lua/utf8CaseMap.d.ts +1 -0
- package/dist-lib/scripting/lua/utf8Patterns.d.ts +21 -1
- package/dist-lib/scripting/lua/wellFormedStrings.d.ts +40 -0
- package/dist-lib/scripting/lua/yajl.d.ts +43 -5
- package/dist-lib/scripting/profilesPresence.d.ts +20 -2
- package/dist-lib/scripting/vfs/ProfileVFS.d.ts +164 -10
- package/dist-lib/scripting/vfs/fsErrors.d.ts +28 -0
- package/dist-lib/scripting/vfs/idbCommit.d.ts +20 -0
- package/dist-lib/storage/appStore.d.ts +24 -9
- package/dist-lib/storage/hooks.d.ts +5 -1
- package/dist-lib/storage/index.d.ts +2 -2
- package/dist-lib/storage/mapStorage.d.ts +2 -0
- package/dist-lib/storage/persistentStorage.d.ts +3 -1
- package/dist-lib/storage/profileStorage.d.ts +15 -0
- package/dist-lib/storage/profileVfsData.d.ts +3 -3
- package/dist-lib/storage/schema.d.ts +512 -40
- package/dist-lib/storage/storageMigration.d.ts +82 -0
- package/dist-lib/storage-g5V1b-c1.js +2039 -0
- package/dist-lib/styles.css +1 -1
- package/dist-lib/ui/AboutModal.d.ts +1 -1
- package/dist-lib/ui/BrandLoginFields.d.ts +1 -1
- package/dist-lib/ui/BrowserSignInModal.d.ts +23 -0
- package/dist-lib/ui/CmdLineMenuRegistry.d.ts +14 -5
- package/dist-lib/ui/CommandBar.d.ts +8 -8
- package/dist-lib/ui/ConnectionFormModal.d.ts +20 -1
- package/dist-lib/ui/ConnectionScreen.d.ts +9 -1
- package/dist-lib/ui/GameLinkPrompt.d.ts +28 -0
- package/dist-lib/ui/HelpModal.d.ts +5 -1
- package/dist-lib/ui/MapSymbolUsageModal.d.ts +32 -0
- package/dist-lib/ui/MouseEventRegistry.d.ts +31 -4
- package/dist-lib/ui/NotepadModal.d.ts +22 -0
- package/dist-lib/ui/ResizableModal.d.ts +16 -1
- package/dist-lib/ui/SettingsModal.d.ts +10 -1
- package/dist-lib/ui/TlsAlertBanner.d.ts +3 -1
- package/dist-lib/ui/Toolbar.d.ts +22 -1
- package/dist-lib/ui/VaultManageButton.d.ts +10 -5
- package/dist-lib/ui/VaultModal.d.ts +3 -0
- package/dist-lib/ui/buttons/ButtonsBar.d.ts +3 -1
- package/dist-lib/ui/buttons/inactiveButtons.d.ts +25 -0
- package/dist-lib/ui/cmdline/CommandLineManager.d.ts +19 -0
- package/dist-lib/ui/cmdline/plainText.d.ts +16 -0
- package/dist-lib/ui/cmdline/subCommandLine.d.ts +78 -0
- package/dist-lib/ui/cmdline/useCmdLineSelection.d.ts +26 -0
- package/dist-lib/ui/cmdline/useSubCommandLineKeys.d.ts +33 -0
- package/dist-lib/ui/codemirror/lineParagraphMarks.d.ts +19 -0
- package/dist-lib/ui/codemirror/luaHover.d.ts +7 -0
- package/dist-lib/ui/codemirror/options.d.ts +33 -0
- package/dist-lib/ui/codemirror/theme.d.ts +29 -5
- package/dist-lib/ui/commands/addonCommands.d.ts +134 -0
- package/dist-lib/ui/commands/appShortcuts.d.ts +86 -0
- package/dist-lib/ui/commands/hostCommands.d.ts +88 -0
- package/dist-lib/ui/commands/keyMatch.d.ts +20 -0
- package/dist-lib/ui/commands/keySequence.d.ts +57 -0
- package/dist-lib/ui/components/ContextMenu.d.ts +21 -1
- package/dist-lib/ui/components/FontPicker.d.ts +5 -1
- package/dist-lib/ui/components/useModalFocus.d.ts +13 -1
- package/dist-lib/ui/helpTopics.d.ts +15 -0
- package/dist-lib/ui/labels/LabelManager.d.ts +172 -9
- package/dist-lib/ui/labels/LabelOverlay.d.ts +19 -0
- package/dist-lib/ui/labels/backgroundImageSize.d.ts +19 -0
- package/dist-lib/ui/labels/labelModel.d.ts +64 -0
- package/dist-lib/ui/labels/qColor.d.ts +13 -0
- package/dist-lib/ui/labels/qtCss.d.ts +12 -4
- package/dist-lib/ui/landmarks.d.ts +9 -0
- package/dist-lib/ui/launcher/ActionMenu.d.ts +19 -0
- package/dist-lib/ui/launcher/GameDetails.d.ts +21 -0
- package/dist-lib/ui/launcher/GameSection.d.ts +18 -0
- package/dist-lib/ui/launcher/LauncherSearch.d.ts +23 -0
- package/dist-lib/ui/launcher/ProfileArt.d.ts +20 -0
- package/dist-lib/ui/launcher/ProfileSection.d.ts +43 -0
- package/dist-lib/ui/launcher/launcherModel.d.ts +72 -0
- package/dist-lib/ui/layout/overlayLayerOrder.d.ts +2 -2
- package/dist-lib/ui/menu/MenuBar.d.ts +31 -0
- package/dist-lib/ui/menu/SplitButton.d.ts +39 -0
- package/dist-lib/ui/menu/anchoredPopup.d.ts +74 -0
- package/dist-lib/ui/menu/appMenus.d.ts +65 -0
- package/dist-lib/ui/menu/menuModel.d.ts +88 -0
- package/dist-lib/ui/menu/toolbarModel.d.ts +56 -0
- package/dist-lib/ui/notepad.d.ts +76 -0
- package/dist-lib/ui/openSignInPage.d.ts +14 -0
- package/dist-lib/ui/output/OutputContextMenu.d.ts +14 -1
- package/dist-lib/ui/output/OutputRenderer.d.ts +5 -0
- package/dist-lib/ui/output/OutputSearchBar.d.ts +5 -1
- package/dist-lib/ui/output/StickyOutputPanel.d.ts +17 -3
- package/dist-lib/ui/output/TextAnalyzerModal.d.ts +25 -0
- package/dist-lib/ui/output/caretMode.d.ts +3 -2
- package/dist-lib/ui/output/clearSplit.d.ts +11 -0
- package/dist-lib/ui/output/outputCopy.d.ts +41 -2
- package/dist-lib/ui/output/outputRows.d.ts +43 -0
- package/dist-lib/ui/output/selectionGesture.d.ts +35 -0
- package/dist-lib/ui/output/wordSelection.d.ts +33 -0
- package/dist-lib/ui/search/matcher.d.ts +14 -4
- package/dist-lib/ui/settings/SettingsShell.d.ts +91 -0
- package/dist-lib/ui/settings/ShortcutEditor.d.ts +13 -0
- package/dist-lib/ui/sound/SoundManager.d.ts +210 -44
- package/dist-lib/ui/sound/closedCaption.d.ts +4 -1
- package/dist-lib/ui/sound/mediaDirection.d.ts +35 -0
- package/dist-lib/ui/tabCompletion.d.ts +53 -0
- package/dist-lib/ui/textedit/TextEditManager.d.ts +11 -2
- package/dist-lib/ui/useOpenProfiles.d.ts +1 -1
- package/dist-lib/ui/video/VideoManager.d.ts +7 -0
- package/dist-lib/ui/windows/WindowManager.d.ts +452 -37
- package/dist-lib/ui/windows/panels/ScriptEditorPanel.d.ts +14 -0
- package/dist-lib/ui/windows/panels/ScriptSearch.d.ts +6 -1
- package/dist-lib/ui/windows/panels/TextPanel.d.ts +4 -1
- package/dist-lib/ui/windows/panels/VariablesView.d.ts +37 -7
- package/dist-lib/ui/windows/panels/WindowCmdLine.d.ts +4 -2
- package/dist-lib/ui/windows/panels/aliasLoop.d.ts +24 -0
- package/dist-lib/ui/windows/panels/editorClipboard.d.ts +45 -0
- package/dist-lib/ui/windows/panels/editorUndo.d.ts +79 -0
- package/dist-lib/ui/windows/panels/mapAreaChange.d.ts +10 -0
- package/dist-lib/utils/appShellCache.d.ts +25 -0
- package/dist-lib/utils/fontFamilyName.d.ts +13 -0
- package/dist-lib/utils/fontLoader.d.ts +31 -0
- package/dist-lib/utils/formatBytes.d.ts +4 -0
- package/dist-lib/utils/mustBeOneOf.d.ts +9 -0
- package/dist-lib/utils/profileLock.d.ts +1 -1
- package/dist-lib/utils/systemTheme.d.ts +24 -0
- package/dist-lib/utils/timeZone.d.ts +10 -0
- package/dist-lib/vault/CredentialVault.d.ts +51 -5
- package/dist-lib/vault/deviceUnlock.d.ts +47 -0
- package/dist-lib/vault/vaultAccess.d.ts +24 -2
- package/dist-lib/vault/vaultHelpTopic.d.ts +9 -0
- package/dist-lib/vault/vaultRecord.d.ts +33 -1
- package/dist-lib/vfs-sw.js +220 -11
- package/dist-lib/vite.d.ts +1 -1
- package/dist-lib/vite.js +66 -43
- package/package.json +22 -14
- package/dist-lib/assets/mapParser.worker-t-3rd1zR.js +0 -9
- package/dist-lib/mud/connection/PingTracker.d.ts +0 -41
- package/dist-lib/ui/BundledGameGrid.d.ts +0 -21
- package/dist-lib/ui/ConnectionGrid.d.ts +0 -21
- package/dist-lib/ui/bufferWords.d.ts +0 -38
|
@@ -3,11 +3,16 @@ export interface StopwatchStore {
|
|
|
3
3
|
load(): string | null;
|
|
4
4
|
save(data: string): void;
|
|
5
5
|
}
|
|
6
|
+
/** localStorage key holding one profile's stopwatches. Shared with the
|
|
7
|
+
* profile-deletion sweep (storage/profileStorage) so the two can't drift. */
|
|
8
|
+
export declare function stopwatchStorageKey(connectionId: string): string;
|
|
6
9
|
/** Build a localStorage-backed store scoped to a connection, or undefined when
|
|
7
10
|
* localStorage is unavailable (tests / SSR) — in which case persistence is a
|
|
8
11
|
* no-op and watches behave as memory-only. */
|
|
9
12
|
export declare function localStorageStopwatchStore(connectionId: string): StopwatchStore | undefined;
|
|
10
|
-
/** Broken-down elapsed time, mirroring Mudlet's generateElapsedTimeTable
|
|
13
|
+
/** Broken-down elapsed time, mirroring Mudlet's generateElapsedTimeTable —
|
|
14
|
+
* what getStopWatchBrokenDownTime answers, which calls it with
|
|
15
|
+
* includeDecimalSeconds false. */
|
|
11
16
|
export interface BrokenDownTime {
|
|
12
17
|
negative: boolean;
|
|
13
18
|
days: number;
|
|
@@ -15,6 +20,10 @@ export interface BrokenDownTime {
|
|
|
15
20
|
minutes: number;
|
|
16
21
|
seconds: number;
|
|
17
22
|
milliSeconds: number;
|
|
23
|
+
}
|
|
24
|
+
/** The elapsedTime getStopWatches reports per watch: the same table with
|
|
25
|
+
* generateElapsedTimeTable's includeDecimalSeconds on. */
|
|
26
|
+
export interface ElapsedTime extends BrokenDownTime {
|
|
18
27
|
/** Signed total seconds (matches Mudlet's elapsedMilliSeconds / 1000). */
|
|
19
28
|
decimalSeconds: number;
|
|
20
29
|
}
|
|
@@ -23,72 +32,124 @@ export interface StopwatchSummary {
|
|
|
23
32
|
name: string;
|
|
24
33
|
isRunning: boolean;
|
|
25
34
|
isPersistent: boolean;
|
|
26
|
-
elapsedTime:
|
|
35
|
+
elapsedTime: ElapsedTime;
|
|
27
36
|
}
|
|
37
|
+
/** A persistent stopwatch as a profile save holds it. */
|
|
38
|
+
export type SavedStopwatch = {
|
|
39
|
+
id: number;
|
|
40
|
+
name: string;
|
|
41
|
+
} & ({
|
|
42
|
+
running: true;
|
|
43
|
+
effectiveStartEpochMs: number;
|
|
44
|
+
} | {
|
|
45
|
+
running: false;
|
|
46
|
+
elapsedMs: number;
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* How a stopwatch was asked for: a number is an ID, a string is a name — only
|
|
50
|
+
* a Lua number is an ID, so "5" names a stopwatch called 5 (Mudlet tests the
|
|
51
|
+
* argument with `lua_type(L, 1) == LUA_TNUMBER`). The empty name stands for the
|
|
52
|
+
* first (lowest ID) unnamed stopwatch.
|
|
53
|
+
*/
|
|
54
|
+
export type StopwatchSubject = number | string;
|
|
55
|
+
/**
|
|
56
|
+
* A refusal, in the words Mudlet's `Host` and `TLuaInterpreter` use for it —
|
|
57
|
+
* the binding hands it to Lua as the second value after nil.
|
|
58
|
+
*/
|
|
59
|
+
export type StopwatchRefusal = {
|
|
60
|
+
refused: string;
|
|
61
|
+
};
|
|
62
|
+
export declare const isRefusal: (v: unknown) => v is StopwatchRefusal;
|
|
28
63
|
export declare class StopwatchManager {
|
|
29
64
|
private readonly storage?;
|
|
30
65
|
private readonly watches;
|
|
31
|
-
private nextId;
|
|
32
66
|
constructor(storage?: StopwatchStore | undefined);
|
|
33
67
|
private now;
|
|
34
68
|
private elapsedMs;
|
|
69
|
+
/** Watches in ascending ID order — Mudlet's std::map, which is what makes
|
|
70
|
+
* "the first unnamed stopwatch" the lowest-numbered one. */
|
|
71
|
+
private ordered;
|
|
72
|
+
/** Host::findStopWatchId — the first watch with this name, '' finding the
|
|
73
|
+
* first unnamed one. */
|
|
74
|
+
private findByName;
|
|
35
75
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
76
|
+
* Look a subject up, or answer the refusal for one that is not there.
|
|
77
|
+
* `idWord` is the one place the family disagrees with itself: the
|
|
78
|
+
* functions that go through `TLuaInterpreter::csmInvalidStopWatchID` say
|
|
79
|
+
* "ID", the ones whose message comes from `Host` say "id".
|
|
40
80
|
*/
|
|
41
|
-
private
|
|
81
|
+
private lookup;
|
|
82
|
+
/** The refusal looking `subject` up gives where TLuaInterpreter's own
|
|
83
|
+
* csmInvalidStopWatchID words it ("ID"), or null when the watch exists. */
|
|
84
|
+
missing(subject: StopwatchSubject): StopwatchRefusal | null;
|
|
85
|
+
/** How Host names a watch in an "already" refusal: the way it was asked for. */
|
|
86
|
+
private describe;
|
|
42
87
|
/** Rehydrate persistent watches from the backing store (called once on construction). */
|
|
43
88
|
private restore;
|
|
89
|
+
/** The persistent watches as desktop's profile save writes them
|
|
90
|
+
* (XMLexport's `<stopwatches>`): a running one by the moment it would have
|
|
91
|
+
* started to reach its elapsed time, a stopped one by that time. */
|
|
92
|
+
savedForProfile(now?: number): SavedStopwatch[];
|
|
44
93
|
/** Write the current set of persistent watches to the backing store. */
|
|
45
94
|
private persist;
|
|
95
|
+
private touched;
|
|
96
|
+
private startWatch;
|
|
97
|
+
private stopWatch;
|
|
98
|
+
/** A stopped watch goes back to never-started; a running one restarts
|
|
99
|
+
* from zero and keeps running. One never started has nothing to reset. */
|
|
100
|
+
private resetWatch;
|
|
46
101
|
/**
|
|
47
|
-
* Mudlet createStopWatch([name], [autostart]). Returns the new id, or
|
|
48
|
-
* when `name` is
|
|
102
|
+
* Mudlet createStopWatch([name], [autostart]). Returns the new id, or the
|
|
103
|
+
* refusal when `name` is already in use (Mudlet rejects duplicate names).
|
|
49
104
|
*/
|
|
50
|
-
create(name: string, autoStart: boolean): number |
|
|
105
|
+
create(name: string, autoStart: boolean): number | StopwatchRefusal;
|
|
51
106
|
/**
|
|
52
107
|
* Mudlet startStopWatch. `resetAndRestart` replicates the legacy behaviour
|
|
53
|
-
* for a numeric id called bare: reset to zero and run from there
|
|
54
|
-
*
|
|
55
|
-
*
|
|
108
|
+
* for a numeric id called bare: reset to zero and run from there, which
|
|
109
|
+
* always succeeds. Asked to keep the elapsed time instead, starting one
|
|
110
|
+
* that is already running is refused.
|
|
56
111
|
*/
|
|
57
|
-
start(
|
|
112
|
+
start(subject: StopwatchSubject, resetAndRestart: boolean): true | StopwatchRefusal;
|
|
58
113
|
/**
|
|
59
114
|
* Mudlet stopStopWatch. Pauses the watch and returns the elapsed seconds
|
|
60
|
-
* once (legacy behaviour preserved by Mudlet).
|
|
115
|
+
* once (legacy behaviour preserved by Mudlet). Stopping one that is
|
|
116
|
+
* already stopped — including one that was never started — is refused.
|
|
61
117
|
*/
|
|
62
|
-
stop(
|
|
118
|
+
stop(subject: StopwatchSubject): number | StopwatchRefusal;
|
|
63
119
|
/** Mudlet getStopWatchTime — elapsed seconds without stopping. */
|
|
64
|
-
getTime(
|
|
120
|
+
getTime(subject: StopwatchSubject): number | StopwatchRefusal;
|
|
65
121
|
/** Mudlet getStopWatchBrokenDownTime — elapsed time as a day/hour/minute/
|
|
66
|
-
* second/millisecond table.
|
|
67
|
-
getBrokenDownTime(
|
|
122
|
+
* second/millisecond table. */
|
|
123
|
+
getBrokenDownTime(subject: StopwatchSubject): BrokenDownTime | StopwatchRefusal;
|
|
68
124
|
/**
|
|
69
|
-
* Mudlet setStopWatchName(
|
|
70
|
-
* a
|
|
71
|
-
*
|
|
125
|
+
* Mudlet `setStopWatchName(id|name, newName)` — Host::setStopWatchName.
|
|
126
|
+
* Refuses a name another stopwatch already carries, naming that one; the
|
|
127
|
+
* empty new name takes a watch's name away again.
|
|
72
128
|
*/
|
|
129
|
+
setName(subject: StopwatchSubject, newName: string): true | StopwatchRefusal;
|
|
130
|
+
/** Mudlet resetStopWatch — zero the elapsed time; a running watch keeps running. */
|
|
131
|
+
reset(subject: StopwatchSubject): true | StopwatchRefusal;
|
|
73
132
|
/**
|
|
74
|
-
* Mudlet `
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
133
|
+
* Mudlet `adjustStopWatch` — add `seconds` (may be negative) to the elapsed
|
|
134
|
+
* time. Time that accumulates past the end of the range stops there; an
|
|
135
|
+
* adjustment asking for more than the whole range is refused with the
|
|
136
|
+
* reason, as every other out-of-range stopwatch argument is.
|
|
137
|
+
*
|
|
138
|
+
* It is the MILLISECONDS the adjustment rounds to that are bounded, since
|
|
139
|
+
* that is what a stopwatch keeps its time in, and the comparison is written
|
|
140
|
+
* so that a NaN or an infinity fails it too.
|
|
78
141
|
*/
|
|
79
|
-
|
|
80
|
-
/** Mudlet resetStopWatch — zero the elapsed time; a running watch keeps running. */
|
|
81
|
-
reset(arg: number | string): boolean;
|
|
82
|
-
/** Mudlet adjustStopWatch — add `seconds` (may be negative) to the elapsed time. */
|
|
83
|
-
adjust(arg: number | string, seconds: number): boolean;
|
|
142
|
+
adjust(subject: StopwatchSubject, seconds: number): true | StopwatchRefusal;
|
|
84
143
|
/** Mudlet deleteStopWatch. */
|
|
85
|
-
delete(
|
|
144
|
+
delete(subject: StopwatchSubject): true | StopwatchRefusal;
|
|
145
|
+
/** Host::removeAllNonPersistentStopWatches, which resetProfile() runs:
|
|
146
|
+
* every watch not flagged persistent goes, freeing its ID. */
|
|
147
|
+
removeNonPersistent(): void;
|
|
86
148
|
/**
|
|
87
149
|
* Mudlet setStopWatchPersistence(id|name, state). Marks whether the watch is
|
|
88
|
-
* saved to (and restored from) the backing store across reloads.
|
|
89
|
-
* false for an unknown watch.
|
|
150
|
+
* saved to (and restored from) the backing store across reloads.
|
|
90
151
|
*/
|
|
91
|
-
setPersistence(
|
|
152
|
+
setPersistence(subject: StopwatchSubject, state: boolean): true | StopwatchRefusal;
|
|
92
153
|
/** Mudlet getStopWatches — record keyed by stringified id (Bridge.lua re-keys to ints). */
|
|
93
154
|
getAll(): Record<string, StopwatchSummary>;
|
|
94
155
|
}
|
|
@@ -15,6 +15,7 @@ export declare class HttpService {
|
|
|
15
15
|
* bundled path resolves the same way Lua's io.open resolves it. */
|
|
16
16
|
private readonly localReader;
|
|
17
17
|
private readonly proxiedOrigins;
|
|
18
|
+
private readonly directOrigins;
|
|
18
19
|
/**
|
|
19
20
|
* The response record Mudlet hands to every HTTP event as its last argument:
|
|
20
21
|
* `{ headers = {...}, cookies = {...} }`. Scripts read it to branch on what
|
|
@@ -31,12 +32,13 @@ export declare class HttpService {
|
|
|
31
32
|
/** Consulted before the profile VFS when serving a `file:` URL, so a
|
|
32
33
|
* bundled path resolves the same way Lua's io.open resolves it. */
|
|
33
34
|
localReader?: LocalReader);
|
|
34
|
-
downloadFile(saveTo: string,
|
|
35
|
+
downloadFile(saveTo: string, rawUrl: string): void;
|
|
35
36
|
getHTTP(url: string, headers?: Record<string, string>): void;
|
|
36
37
|
postHTTP(data: string | null, url: string, headers?: Record<string, string>, file?: string): void;
|
|
37
38
|
putHTTP(data: string | null, url: string, headers?: Record<string, string>, file?: string): void;
|
|
38
39
|
deleteHTTP(url: string, headers?: Record<string, string>): void;
|
|
39
40
|
customHTTP(method: string, data: string | null, url: string, headers?: Record<string, string>, file?: string): void;
|
|
41
|
+
private upload;
|
|
40
42
|
/**
|
|
41
43
|
* Serve a `file:` URL out of the VFS, reporting through the same
|
|
42
44
|
* sysDownloadDone/sysDownloadError a network download would.
|
|
@@ -66,8 +68,14 @@ export declare class HttpService {
|
|
|
66
68
|
* its timer queue instead.
|
|
67
69
|
*/
|
|
68
70
|
private emitLater;
|
|
71
|
+
/** Raise `event` unless it is '' — the "no event" a HEAD finishes with. */
|
|
72
|
+
private emitNamed;
|
|
69
73
|
private bodyForUpload;
|
|
70
74
|
private runRequest;
|
|
71
75
|
private fetchWithFallback;
|
|
76
|
+
private fetchViaProxy;
|
|
77
|
+
private checkProxyReply;
|
|
78
|
+
private isProxied;
|
|
79
|
+
private answersCors;
|
|
72
80
|
}
|
|
73
81
|
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read a url the way Mudlet does before it issues any request: through
|
|
3
|
+
* `QUrl::fromUserInput`. Scripts pass bare `example.com/x` or `127.0.0.1:8080/x`
|
|
4
|
+
* and Mudlet means http by them. fetch() would instead resolve such a string
|
|
5
|
+
* *relative to the page* — fetching the web app's own index.html and reporting
|
|
6
|
+
* success — so every url is put through this before it goes anywhere.
|
|
7
|
+
*
|
|
8
|
+
* The rules, as fromUserInput has them:
|
|
9
|
+
* - an absolute local path (`/x/y`) is a `file:` url;
|
|
10
|
+
* - an explicit scheme is kept, unless what looks like one is really a host
|
|
11
|
+
* followed by a port (`localhost:8080/x`), which gets http prepended;
|
|
12
|
+
* - anything else gets http prepended.
|
|
13
|
+
*
|
|
14
|
+
* The result is the string the request goes to, the string the HTTP functions
|
|
15
|
+
* return, and the string their events report.
|
|
16
|
+
*/
|
|
17
|
+
export declare function normalizeUserUrl(raw: string): string;
|
|
18
|
+
/** Why `raw` is not a usable url, or null when it is. */
|
|
19
|
+
export declare function userUrlInvalidReason(raw: string): string | null;
|
|
20
|
+
/**
|
|
21
|
+
* A `file:` url's host and fully decoded path, read the way QUrl reads them,
|
|
22
|
+
* or null when `url` is not a file url. Not the WHATWG parser: that one drops a
|
|
23
|
+
* `localhost` host and folds a path that starts `//` into the host, both of
|
|
24
|
+
* which the checks below need to see.
|
|
25
|
+
*/
|
|
26
|
+
export declare function fileUrlParts(url: string): {
|
|
27
|
+
host: string;
|
|
28
|
+
path: string;
|
|
29
|
+
} | null;
|
|
30
|
+
/**
|
|
31
|
+
* Why Mudlet refuses `raw` before issuing a request, as the whole reason that
|
|
32
|
+
* follows "url is invalid, reason: " (TLuaInterpreter::getHTTP and friends), or
|
|
33
|
+
* null when it may be used.
|
|
34
|
+
*
|
|
35
|
+
* Only http and https may be fetched: file:, qrc:, data: and the like would hand
|
|
36
|
+
* local or bundled content back as though it had been downloaded. downloadFile()
|
|
37
|
+
* alone also takes a local file — it copies to a path the script chose rather
|
|
38
|
+
* than handing the content back — but only one on this machine: a file url
|
|
39
|
+
* naming another host, or a path naming a share, is a network path on Windows.
|
|
40
|
+
*/
|
|
41
|
+
export declare function userUrlRefusal(raw: string, allowLocalFile: boolean): string | null;
|