@mudlet/mudlet-web 0.3.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 (242) hide show
  1. package/LICENSE +338 -0
  2. package/README.md +150 -0
  3. package/dist-lib/App.d.ts +1 -0
  4. package/dist-lib/MudletWebApp.d.ts +11 -0
  5. package/dist-lib/ProfileSession.d.ts +15 -0
  6. package/dist-lib/assets/mapParser.worker-t-3rd1zR.js +9 -0
  7. package/dist-lib/branding.d.ts +213 -0
  8. package/dist-lib/core/EventBus.d.ts +29 -0
  9. package/dist-lib/db/sqliteClient.d.ts +25 -0
  10. package/dist-lib/hooks/useEngines.d.ts +12 -0
  11. package/dist-lib/hooks/useMudSession.d.ts +10 -0
  12. package/dist-lib/hooks/useOutput.d.ts +17 -0
  13. package/dist-lib/hooks/useViewportMode.d.ts +14 -0
  14. package/dist-lib/import/applyMudletProfile.d.ts +57 -0
  15. package/dist-lib/import/collectProfileExport.d.ts +16 -0
  16. package/dist-lib/import/defaultPackages.d.ts +81 -0
  17. package/dist-lib/import/defaults/mudlet-mapper.xml +13023 -0
  18. package/dist-lib/import/defaults/run-lua-code.mpackage +0 -0
  19. package/dist-lib/import/mudletHost.d.ts +67 -0
  20. package/dist-lib/import/mudletLink.d.ts +34 -0
  21. package/dist-lib/import/mudletProfileExport.d.ts +49 -0
  22. package/dist-lib/import/mudletProfileImport.d.ts +71 -0
  23. package/dist-lib/import/mudletVariables.d.ts +49 -0
  24. package/dist-lib/import/mudletWriteback.d.ts +12 -0
  25. package/dist-lib/import/mudletXmlExport.d.ts +16 -0
  26. package/dist-lib/import/mudletXmlImport.d.ts +21 -0
  27. package/dist-lib/import/packageInstaller.d.ts +72 -0
  28. package/dist-lib/import/packageRepository.d.ts +54 -0
  29. package/dist-lib/import/remotePackageInstall.d.ts +52 -0
  30. package/dist-lib/index.d.ts +30 -0
  31. package/dist-lib/index.js +42307 -0
  32. package/dist-lib/logging/SessionLogger.d.ts +41 -0
  33. package/dist-lib/main.d.ts +2 -0
  34. package/dist-lib/map/MapSelectionOverlay.d.ts +15 -0
  35. package/dist-lib/map/MapStore.d.ts +1067 -0
  36. package/dist-lib/map/MudixMapReader.d.ts +90 -0
  37. package/dist-lib/map/MudletHighlightOverlay.d.ts +18 -0
  38. package/dist-lib/map/mapImageExport.d.ts +26 -0
  39. package/dist-lib/map/mapParser.worker.d.ts +1 -0
  40. package/dist-lib/map/mapParserClient.d.ts +35 -0
  41. package/dist-lib/map/pathfinding.d.ts +52 -0
  42. package/dist-lib/map/xmlMapImport.d.ts +28 -0
  43. package/dist-lib/mud/MudSession.d.ts +236 -0
  44. package/dist-lib/mud/PatternEngine.d.ts +28 -0
  45. package/dist-lib/mud/aliases/AliasEngine.d.ts +15 -0
  46. package/dist-lib/mud/connection/LineAssembler.d.ts +84 -0
  47. package/dist-lib/mud/connection/MudClient.d.ts +268 -0
  48. package/dist-lib/mud/connection/PingTracker.d.ts +28 -0
  49. package/dist-lib/mud/connection/TelnetNegotiator.d.ts +188 -0
  50. package/dist-lib/mud/connection/telnetDebug.d.ts +54 -0
  51. package/dist-lib/mud/events.d.ts +160 -0
  52. package/dist-lib/mud/keybindings/KeyEngine.d.ts +36 -0
  53. package/dist-lib/mud/keybindings/browserReservedKeys.d.ts +45 -0
  54. package/dist-lib/mud/keybindings/qtKeys.d.ts +33 -0
  55. package/dist-lib/mud/protocol/charset.d.ts +105 -0
  56. package/dist-lib/mud/protocol/constants.d.ts +116 -0
  57. package/dist-lib/mud/protocol/echo.d.ts +63 -0
  58. package/dist-lib/mud/protocol/gmcp.d.ts +28 -0
  59. package/dist-lib/mud/protocol/index.d.ts +11 -0
  60. package/dist-lib/mud/protocol/mccp.d.ts +18 -0
  61. package/dist-lib/mud/protocol/mnes.d.ts +83 -0
  62. package/dist-lib/mud/protocol/msdp.d.ts +19 -0
  63. package/dist-lib/mud/protocol/msp.d.ts +47 -0
  64. package/dist-lib/mud/protocol/mssp.d.ts +25 -0
  65. package/dist-lib/mud/protocol/mxp.d.ts +188 -0
  66. package/dist-lib/mud/protocol/naws.d.ts +7 -0
  67. package/dist-lib/mud/replay/ReplayPlayer.d.ts +31 -0
  68. package/dist-lib/mud/replay/ReplayRecorder.d.ts +18 -0
  69. package/dist-lib/mud/replay/replayFormat.d.ts +49 -0
  70. package/dist-lib/mud/text/Console.d.ts +183 -0
  71. package/dist-lib/mud/text/FormatState.d.ts +256 -0
  72. package/dist-lib/mud/text/ansiEscapes.d.ts +88 -0
  73. package/dist-lib/mud/text/cellRender.d.ts +21 -0
  74. package/dist-lib/mud/text/colorParsers.d.ts +54 -0
  75. package/dist-lib/mud/text/colors.d.ts +31 -0
  76. package/dist-lib/mud/text/controlCharacterMode.d.ts +13 -0
  77. package/dist-lib/mud/text/controlChars.d.ts +31 -0
  78. package/dist-lib/mud/text/hyperlinkConfig.d.ts +164 -0
  79. package/dist-lib/mud/text/hyperlinkVisibility.d.ts +37 -0
  80. package/dist-lib/mud/text/oscLinkManager.d.ts +35 -0
  81. package/dist-lib/mud/text/wcwidth.d.ts +44 -0
  82. package/dist-lib/mud/text/xterm256.d.ts +2 -0
  83. package/dist-lib/mud/timers/TimerEngine.d.ts +61 -0
  84. package/dist-lib/mud/triggers/ChunkProcessor.d.ts +11 -0
  85. package/dist-lib/mud/triggers/TriggerEngine.d.ts +188 -0
  86. package/dist-lib/mud/triggers/pcre/Pcre2.d.ts +26 -0
  87. package/dist-lib/scripting/EngineHost.d.ts +152 -0
  88. package/dist-lib/scripting/GlobalEventChannel.d.ts +36 -0
  89. package/dist-lib/scripting/IScriptingRuntime.d.ts +95 -0
  90. package/dist-lib/scripting/MapOpenNotifier.d.ts +19 -0
  91. package/dist-lib/scripting/ScriptingAPI.d.ts +1691 -0
  92. package/dist-lib/scripting/ScriptingEngine.d.ts +806 -0
  93. package/dist-lib/scripting/StopwatchManager.d.ts +94 -0
  94. package/dist-lib/scripting/heldModifiers.d.ts +3 -0
  95. package/dist-lib/scripting/http/HttpService.d.ts +23 -0
  96. package/dist-lib/scripting/lua/LuaRuntime.d.ts +190 -0
  97. package/dist-lib/scripting/lua/bindings/automation.d.ts +10 -0
  98. package/dist-lib/scripting/lua/bindings/commandLine.d.ts +11 -0
  99. package/dist-lib/scripting/lua/bindings/context.d.ts +87 -0
  100. package/dist-lib/scripting/lua/bindings/cursor.d.ts +10 -0
  101. package/dist-lib/scripting/lua/bindings/diagnostics.d.ts +9 -0
  102. package/dist-lib/scripting/lua/bindings/map.d.ts +14 -0
  103. package/dist-lib/scripting/lua/bindings/media.d.ts +24 -0
  104. package/dist-lib/scripting/lua/bindings/output.d.ts +10 -0
  105. package/dist-lib/scripting/lua/bindings/packages.d.ts +10 -0
  106. package/dist-lib/scripting/lua/bindings/session.d.ts +16 -0
  107. package/dist-lib/scripting/lua/bindings/textEdit.d.ts +9 -0
  108. package/dist-lib/scripting/lua/bindings/userWindows.d.ts +11 -0
  109. package/dist-lib/scripting/lua/bindings/window.d.ts +10 -0
  110. package/dist-lib/scripting/lua/imageSize.d.ts +4 -0
  111. package/dist-lib/scripting/lua/luaCompletions.d.ts +9 -0
  112. package/dist-lib/scripting/lua/mudlet-lua/generic-mapper/generic_mapper.mpackage +0 -0
  113. package/dist-lib/scripting/lua/rex.d.ts +3 -0
  114. package/dist-lib/scripting/lua/sqlRowEncoder.d.ts +1 -0
  115. package/dist-lib/scripting/lua/yajl.d.ts +11 -0
  116. package/dist-lib/scripting/profilesPresence.d.ts +50 -0
  117. package/dist-lib/scripting/vfs/ProfileVFS.d.ts +62 -0
  118. package/dist-lib/scripting/vfs/cssRewrite.d.ts +21 -0
  119. package/dist-lib/scripting/vfs/folderHandleStore.d.ts +16 -0
  120. package/dist-lib/scripting/vfs/folderSync.d.ts +59 -0
  121. package/dist-lib/scripting/vfs/htmlRewrite.d.ts +26 -0
  122. package/dist-lib/scripting/vfs/vfsBridge.d.ts +16 -0
  123. package/dist-lib/services/cloudflare.d.ts +54 -0
  124. package/dist-lib/storage/appStore.d.ts +132 -0
  125. package/dist-lib/storage/crossTabSync.d.ts +3 -0
  126. package/dist-lib/storage/debouncedStorage.d.ts +18 -0
  127. package/dist-lib/storage/hooks.d.ts +17 -0
  128. package/dist-lib/storage/index.d.ts +4 -0
  129. package/dist-lib/storage/logExport.d.ts +32 -0
  130. package/dist-lib/storage/logStorage.d.ts +45 -0
  131. package/dist-lib/storage/mapStorage.d.ts +2 -0
  132. package/dist-lib/storage/profileVfsData.d.ts +47 -0
  133. package/dist-lib/storage/schema.d.ts +638 -0
  134. package/dist-lib/styles.css +2 -0
  135. package/dist-lib/ui/AboutModal.d.ts +8 -0
  136. package/dist-lib/ui/BrandLoginFields.d.ts +25 -0
  137. package/dist-lib/ui/BrandLoginScreen.d.ts +11 -0
  138. package/dist-lib/ui/CharLoginModal.d.ts +32 -0
  139. package/dist-lib/ui/CmdLineMenuRegistry.d.ts +27 -0
  140. package/dist-lib/ui/CodeEditorPreview.d.ts +19 -0
  141. package/dist-lib/ui/CommandBar.d.ts +17 -0
  142. package/dist-lib/ui/ConnectionFormModal.d.ts +13 -0
  143. package/dist-lib/ui/ConnectionGrid.d.ts +18 -0
  144. package/dist-lib/ui/ConnectionScreen.d.ts +14 -0
  145. package/dist-lib/ui/FileBrowserModal.d.ts +20 -0
  146. package/dist-lib/ui/FilePickerModal.d.ts +21 -0
  147. package/dist-lib/ui/FolderPermissionScreen.d.ts +16 -0
  148. package/dist-lib/ui/JsonPreview.d.ts +15 -0
  149. package/dist-lib/ui/LogBrowserModal.d.ts +7 -0
  150. package/dist-lib/ui/MapEditorModal.d.ts +9 -0
  151. package/dist-lib/ui/MarkdownPreview.d.ts +15 -0
  152. package/dist-lib/ui/MergeConflictModal.d.ts +17 -0
  153. package/dist-lib/ui/ModuleResolveModal.d.ts +22 -0
  154. package/dist-lib/ui/MouseEventRegistry.d.ts +31 -0
  155. package/dist-lib/ui/ProfileBusyScreen.d.ts +12 -0
  156. package/dist-lib/ui/ProfileExportModal.d.ts +7 -0
  157. package/dist-lib/ui/ProxyInfoModal.d.ts +6 -0
  158. package/dist-lib/ui/ProxyWhyModal.d.ts +6 -0
  159. package/dist-lib/ui/ProxyWizardModal.d.ts +6 -0
  160. package/dist-lib/ui/QuickOpenPalette.d.ts +8 -0
  161. package/dist-lib/ui/ResizableModal.d.ts +17 -0
  162. package/dist-lib/ui/ScriptingDocsModal.d.ts +12 -0
  163. package/dist-lib/ui/SettingsModal.d.ts +9 -0
  164. package/dist-lib/ui/Toolbar.d.ts +29 -0
  165. package/dist-lib/ui/bufferWords.d.ts +38 -0
  166. package/dist-lib/ui/buttons/ButtonsBar.d.ts +21 -0
  167. package/dist-lib/ui/cmdline/CommandLineManager.d.ts +97 -0
  168. package/dist-lib/ui/cmdline/CommandLineOverlay.d.ts +8 -0
  169. package/dist-lib/ui/codemirror/theme.d.ts +5 -0
  170. package/dist-lib/ui/commandHistory.d.ts +31 -0
  171. package/dist-lib/ui/components/Button.d.ts +9 -0
  172. package/dist-lib/ui/components/ConfirmDialog.d.ts +29 -0
  173. package/dist-lib/ui/components/ContextMenu.d.ts +9 -0
  174. package/dist-lib/ui/components/FontPicker.d.ts +9 -0
  175. package/dist-lib/ui/components/FormField.d.ts +16 -0
  176. package/dist-lib/ui/components/HelpTip.d.ts +7 -0
  177. package/dist-lib/ui/components/Input.d.ts +6 -0
  178. package/dist-lib/ui/components/Toggle.d.ts +10 -0
  179. package/dist-lib/ui/components/index.d.ts +9 -0
  180. package/dist-lib/ui/components/useModalFocus.d.ts +18 -0
  181. package/dist-lib/ui/labels/LabelManager.d.ts +220 -0
  182. package/dist-lib/ui/labels/LabelOverlay.d.ts +9 -0
  183. package/dist-lib/ui/labels/backgroundImageSize.d.ts +10 -0
  184. package/dist-lib/ui/labels/cursorShapes.d.ts +6 -0
  185. package/dist-lib/ui/labels/gifMovie.d.ts +100 -0
  186. package/dist-lib/ui/labels/qtCss.d.ts +57 -0
  187. package/dist-lib/ui/layout/ContentLayout.d.ts +19 -0
  188. package/dist-lib/ui/layout/DockArea.d.ts +14 -0
  189. package/dist-lib/ui/layout/DockedPanel.d.ts +13 -0
  190. package/dist-lib/ui/layout/FloatingWindowLayer.d.ts +10 -0
  191. package/dist-lib/ui/layout/MobileLayout.d.ts +22 -0
  192. package/dist-lib/ui/layout/PopoutWindow.d.ts +35 -0
  193. package/dist-lib/ui/layout/ScriptWindow.d.ts +29 -0
  194. package/dist-lib/ui/layout/SplitGroupPanel.d.ts +17 -0
  195. package/dist-lib/ui/layout/TabGroupPanel.d.ts +12 -0
  196. package/dist-lib/ui/layout/WindowContextMenu.d.ts +11 -0
  197. package/dist-lib/ui/layout/dockDetect.d.ts +26 -0
  198. package/dist-lib/ui/layout/overlayLayerOrder.d.ts +71 -0
  199. package/dist-lib/ui/markdown.d.ts +1 -0
  200. package/dist-lib/ui/output/CaretReviewPanel.d.ts +22 -0
  201. package/dist-lib/ui/output/OutputArea.d.ts +9 -0
  202. package/dist-lib/ui/output/OutputContextMenu.d.ts +23 -0
  203. package/dist-lib/ui/output/OutputRenderer.d.ts +64 -0
  204. package/dist-lib/ui/output/ScreenReaderLog.d.ts +23 -0
  205. package/dist-lib/ui/output/StickyOutputPanel.d.ts +28 -0
  206. package/dist-lib/ui/output/backgroundImageStyle.d.ts +17 -0
  207. package/dist-lib/ui/output/caretMode.d.ts +40 -0
  208. package/dist-lib/ui/output/linkNavigation.d.ts +29 -0
  209. package/dist-lib/ui/output/osc8Menu.d.ts +16 -0
  210. package/dist-lib/ui/output/outputCopy.d.ts +15 -0
  211. package/dist-lib/ui/preventPinchZoom.d.ts +1 -0
  212. package/dist-lib/ui/scrollbox/ScrollBoxManager.d.ts +62 -0
  213. package/dist-lib/ui/scrollbox/ScrollBoxOverlay.d.ts +25 -0
  214. package/dist-lib/ui/sound/SoundManager.d.ts +149 -0
  215. package/dist-lib/ui/sound/closedCaption.d.ts +37 -0
  216. package/dist-lib/ui/textedit/TextEditManager.d.ts +56 -0
  217. package/dist-lib/ui/tts/TtsManager.d.ts +68 -0
  218. package/dist-lib/ui/useBrandLogin.d.ts +19 -0
  219. package/dist-lib/ui/useCommandHistory.d.ts +7 -0
  220. package/dist-lib/ui/video/VideoManager.d.ts +56 -0
  221. package/dist-lib/ui/windows/ScriptEditorModal.d.ts +13 -0
  222. package/dist-lib/ui/windows/WindowManager.d.ts +694 -0
  223. package/dist-lib/ui/windows/panels/HtmlPanel.d.ts +27 -0
  224. package/dist-lib/ui/windows/panels/LuaEditor.d.ts +14 -0
  225. package/dist-lib/ui/windows/panels/MapPanel.d.ts +8 -0
  226. package/dist-lib/ui/windows/panels/PackageRepositoryModal.d.ts +18 -0
  227. package/dist-lib/ui/windows/panels/ScriptEditorPanel.d.ts +24 -0
  228. package/dist-lib/ui/windows/panels/ScriptSearch.d.ts +12 -0
  229. package/dist-lib/ui/windows/panels/TextPanel.d.ts +35 -0
  230. package/dist-lib/ui/windows/panels/VariablesView.d.ts +21 -0
  231. package/dist-lib/ui/windows/panels/VfsModulePickerModal.d.ts +8 -0
  232. package/dist-lib/ui/windows/panels/WindowCmdLine.d.ts +23 -0
  233. package/dist-lib/ui/windows/types.d.ts +145 -0
  234. package/dist-lib/utils/documentTitle.d.ts +33 -0
  235. package/dist-lib/utils/fontLoader.d.ts +52 -0
  236. package/dist-lib/utils/profileLock.d.ts +26 -0
  237. package/dist-lib/utils/sessionCredentials.d.ts +16 -0
  238. package/dist-lib/version.d.ts +39 -0
  239. package/dist-lib/vfs-sw.js +131 -0
  240. package/dist-lib/vite.d.ts +2 -0
  241. package/dist-lib/vite.js +154 -0
  242. package/package.json +93 -0
@@ -0,0 +1,97 @@
1
+ import { OverlayLayerOrder } from '../layout/overlayLayerOrder';
2
+ export interface CmdLineCreateOptions {
3
+ /** Parent window id ('main' for the main viewport). */
4
+ parent?: string;
5
+ x: number;
6
+ y: number;
7
+ width: number;
8
+ height: number;
9
+ }
10
+ export interface CmdLineState {
11
+ name: string;
12
+ parent: string;
13
+ x: number;
14
+ y: number;
15
+ width: number;
16
+ height: number;
17
+ visible: boolean;
18
+ /** Last value pushed from script (printCmdLine / clearCmdLine / appendCmdLine).
19
+ * The React input owns its own typed state; this seed is only applied when
20
+ * `valueSeq` changes, mirroring the per-userwindow command-line pattern. */
21
+ value: string;
22
+ valueSeq: number;
23
+ /** When false, the input is rendered with the `disabled` attribute so the
24
+ * user can't focus/type. Mudlet disableCommandLine(name). */
25
+ enabled: boolean;
26
+ /** Raw Qt-style CSS string from setCmdLineStyleSheet. Translated to scoped
27
+ * CSS at render time via {@link cmdLineQssToScopedCss}. */
28
+ styleSheet?: string;
29
+ /** Lua-side Enter handler. Plain field; not part of the React snapshot. */
30
+ action: ((text: string) => void) | null;
31
+ }
32
+ type Listener = (cmdLines: CmdLineState[]) => void;
33
+ /**
34
+ * Registry for overlay command-line widgets (Mudlet createCommandLine). Mirrors
35
+ * {@link LabelManager}'s shape: per-parent subscribers, one Map keyed by name.
36
+ *
37
+ * Distinct from {@link WindowManager}'s per-userwindow command lines — those are
38
+ * dockview-panel inputs gated by enableCommandLine; these are absolutely-
39
+ * positioned overlay `<input>` elements on top of a parent viewport, sibling to
40
+ * createLabel.
41
+ */
42
+ export declare class CommandLineManager {
43
+ readonly overlayZ: OverlayLayerOrder;
44
+ private readonly cmdLines;
45
+ private readonly listeners;
46
+ /** Per-cmdline live value probe registered by the React mount. Lets
47
+ * ScriptingAPI.getCmdLine read the current typed text without round-
48
+ * tripping through React state. */
49
+ private readonly valueProbes;
50
+ /** Per-cmdline imperative control registered by the React mount —
51
+ * selectAll() drives <input>.select() (Mudlet selectCmdLineText). */
52
+ private readonly controls;
53
+ constructor(overlayZ?: OverlayLayerOrder);
54
+ /** Mudlet createCommandLine(name, x, y, w, h) — false when a cmd line with
55
+ * that name already exists. */
56
+ create(name: string, opts: CmdLineCreateOptions): boolean;
57
+ has(name: string): boolean;
58
+ /** Read-only handle on a command line's stored state, for the geometry and
59
+ * visibility getters (getWindowGeometry, windowVisible). */
60
+ get(name: string): Readonly<CmdLineState> | undefined;
61
+ destroy(name: string): boolean;
62
+ move(name: string, x: number, y: number): boolean;
63
+ resize(name: string, width: number, height: number): boolean;
64
+ /** Mudlet setWindow — reparent a command line into another window's
65
+ * overlay. Both the old and the new parent's overlays re-render. */
66
+ setParent(name: string, parent: string): boolean;
67
+ show(name: string): boolean;
68
+ hide(name: string): boolean;
69
+ raise(name: string): boolean;
70
+ lower(name: string): boolean;
71
+ enable(name: string): boolean;
72
+ disable(name: string): boolean;
73
+ setStyleSheet(name: string, css: string): boolean;
74
+ /** Mudlet printCmdLine — replace contents, caret to end. */
75
+ setValue(name: string, text: string): boolean;
76
+ /** Mudlet appendCmdLine — push onto the end of the current contents. */
77
+ appendValue(name: string, text: string): boolean;
78
+ /** Mudlet clearCmdLine — wipe the contents. */
79
+ clearValue(name: string): boolean;
80
+ /** Mudlet getCmdLine — live value via the React-registered probe, falling
81
+ * back to the last seed when nothing has mounted yet. */
82
+ getValue(name: string): string;
83
+ setAction(name: string, cb: ((text: string) => void) | null): boolean;
84
+ getAction(name: string): ((text: string) => void) | null;
85
+ hasAction(name: string): boolean;
86
+ /** Mudlet selectCmdLineText — highlight all text in the input. */
87
+ selectAll(name: string): boolean;
88
+ registerValueProbe(name: string, probe: () => string): () => void;
89
+ registerControl(name: string, ctrl: {
90
+ selectAll: () => void;
91
+ }): () => void;
92
+ list(parent: string): CmdLineState[];
93
+ subscribe(parent: string, fn: Listener): () => void;
94
+ clearAll(): void;
95
+ private notify;
96
+ }
97
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { CommandLineManager } from './CommandLineManager';
2
+ import './CommandLineOverlay.css';
3
+ interface CommandLineOverlayProps {
4
+ manager: CommandLineManager;
5
+ parent: string;
6
+ }
7
+ export declare function CommandLineOverlay({ manager, parent }: CommandLineOverlayProps): import("react/jsx-runtime").JSX.Element | null;
8
+ export {};
@@ -0,0 +1,5 @@
1
+ import { Compartment } from '@codemirror/state';
2
+ import { syntaxHighlighting } from '@codemirror/language';
3
+ export declare const mudixCmTheme: import("@codemirror/state").Extension;
4
+ export declare const highlightCompartment: Compartment;
5
+ export declare function highlightFor(theme: string): ReturnType<typeof syntaxHighlighting>;
@@ -0,0 +1,31 @@
1
+ export declare const MAX_HISTORY = 500;
2
+ /** Default number of entries persisted to localStorage when the profile hasn't
3
+ * set Mudlet's `commandLineHistorySaveSize`. Matches MAX_HISTORY so existing
4
+ * histories survive untouched until the user opts into a smaller save cap. */
5
+ export declare const DEFAULT_HISTORY_SAVE_SIZE = 500;
6
+ /** localStorage key for a profile's command history. History is per-profile —
7
+ * one MUD's commands shouldn't surface in another's. The bare prefix (no
8
+ * connection) backs the connection screen before a profile is open. */
9
+ export declare function historyStorageKey(connectionId: string | null): string;
10
+ export declare function loadHistory(key: string): string[];
11
+ /** Persist the MRU history, keeping at most `saveSize` entries (Mudlet's
12
+ * `commandLineHistorySaveSize`). A negative size means "no cap"; the in-memory
13
+ * list is still bounded by MAX_HISTORY via {@link addToHistory}. */
14
+ export declare function saveHistory(items: string[], key: string, saveSize?: number): void;
15
+ export declare function addToHistory(history: string[], item: string): string[];
16
+ export type MatchKind = 'prefix-start' | 'prefix-mid' | 'subseq';
17
+ export interface Match {
18
+ item: string;
19
+ mruIndex: number;
20
+ kind: MatchKind;
21
+ /** First match position used as the LCP anchor. */
22
+ anchor: number;
23
+ /** [start, end) ranges over `item` to visually highlight. */
24
+ ranges: Array<[number, number]>;
25
+ }
26
+ export declare function matchHistory(prefix: string, history: string[], limit?: number): Match[];
27
+ /** Longest common prefix across all matches, measured from each match's anchor.
28
+ * Returns the would-be replacement string if it extends the current prefix,
29
+ * null otherwise. Case-insensitive comparison; the returned string preserves
30
+ * the casing of the top-ranked match. */
31
+ export declare function computeLcp(matches: Match[], prefix: string): string | null;
@@ -0,0 +1,9 @@
1
+ import type { ButtonHTMLAttributes } from 'react';
2
+ type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'icon' | 'danger';
3
+ type ButtonSize = 'sm' | 'md';
4
+ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
5
+ variant?: ButtonVariant;
6
+ size?: ButtonSize;
7
+ }
8
+ export declare function Button({ variant, size, className, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,29 @@
1
+ import { type ReactNode } from 'react';
2
+ export interface ConfirmButton<T = unknown> {
3
+ label: string;
4
+ value: T;
5
+ variant?: 'primary' | 'secondary' | 'danger' | 'ghost';
6
+ autoFocus?: boolean;
7
+ }
8
+ export interface ConfirmOptions<T = unknown> {
9
+ title?: string;
10
+ message?: ReactNode;
11
+ /** Buttons rendered in order, left to right. Last button is treated as the default if none specifies `autoFocus`. */
12
+ buttons?: ConfirmButton<T>[];
13
+ /** Returned when the user dismisses via ESC or backdrop click. */
14
+ dismissValue?: T;
15
+ /** Disable backdrop-click and ESC dismissal. */
16
+ blocking?: boolean;
17
+ /** Visual hint that the action is destructive — adds an icon and styling. */
18
+ tone?: 'default' | 'danger';
19
+ }
20
+ interface DialogProps<T> extends ConfirmOptions<T> {
21
+ onResolve: (value: T | undefined) => void;
22
+ }
23
+ export declare function ConfirmDialog<T>({ title, message, buttons, dismissValue, blocking, tone, onResolve, }: DialogProps<T>): import("react/jsx-runtime").JSX.Element;
24
+ type ConfirmFn = <T = boolean>(options: ConfirmOptions<T>) => Promise<T | undefined>;
25
+ export declare function ConfirmProvider({ children }: {
26
+ children: ReactNode;
27
+ }): import("react/jsx-runtime").JSX.Element;
28
+ export declare function useConfirm(): ConfirmFn;
29
+ export {};
@@ -0,0 +1,9 @@
1
+ import './ContextMenu.css';
2
+ interface ContextMenuProps {
3
+ x: number;
4
+ y: number;
5
+ onClose: () => void;
6
+ children: React.ReactNode;
7
+ }
8
+ export declare function ContextMenu({ x, y, onClose, children }: ContextMenuProps): import("react").ReactPortal;
9
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { ProfileVFS } from '../../scripting/vfs/ProfileVFS';
2
+ import type { OutputFontSource } from '../../storage';
3
+ interface FontPickerProps {
4
+ value: OutputFontSource | undefined;
5
+ onChange: (next: OutputFontSource | undefined) => void;
6
+ vfs: ProfileVFS | null;
7
+ }
8
+ export declare function FontPicker({ value, onChange, vfs }: FontPickerProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { ReactNode } from 'react';
2
+ interface FormFieldProps {
3
+ label: string;
4
+ htmlFor?: string;
5
+ className?: string;
6
+ children: ReactNode;
7
+ }
8
+ export declare function FormField({ label, htmlFor, className, children }: FormFieldProps): import("react/jsx-runtime").JSX.Element;
9
+ interface CheckFieldProps {
10
+ label: string;
11
+ htmlFor?: string;
12
+ className?: string;
13
+ children: ReactNode;
14
+ }
15
+ export declare function CheckField({ label, htmlFor, className, children }: CheckFieldProps): import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -0,0 +1,7 @@
1
+ import { type ReactNode } from 'react';
2
+ interface HelpTipProps {
3
+ label?: string;
4
+ children: ReactNode;
5
+ }
6
+ export declare function HelpTip({ label, children }: HelpTipProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ import { type InputHTMLAttributes } from 'react';
2
+ interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
3
+ noAutofill?: boolean;
4
+ }
5
+ export declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<HTMLInputElement>>;
6
+ export {};
@@ -0,0 +1,10 @@
1
+ interface ToggleProps {
2
+ id?: string;
3
+ checked: boolean;
4
+ onChange: (next: boolean) => void;
5
+ disabled?: boolean;
6
+ 'aria-label'?: string;
7
+ 'aria-labelledby'?: string;
8
+ }
9
+ export declare function Toggle({ id, checked, onChange, disabled, ...aria }: ToggleProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,9 @@
1
+ export { Button } from './Button';
2
+ export { Input } from './Input';
3
+ export { FormField, CheckField } from './FormField';
4
+ export { ContextMenu } from './ContextMenu';
5
+ export { ConfirmDialog, ConfirmProvider, useConfirm } from './ConfirmDialog';
6
+ export type { ConfirmButton, ConfirmOptions } from './ConfirmDialog';
7
+ export { FontPicker } from './FontPicker';
8
+ export { Toggle } from './Toggle';
9
+ export { HelpTip } from './HelpTip';
@@ -0,0 +1,18 @@
1
+ /** Visible (Tab-reachable) focusable descendants of `container`, in DOM order. */
2
+ export declare function focusableWithin(container: HTMLElement): HTMLElement[];
3
+ /**
4
+ * Where a Tab/Shift+Tab should send focus to keep it inside the dialog, or null
5
+ * to let the browser move focus normally (the common case, mid-list). Wraps at
6
+ * the ends and pulls focus back in if it has escaped the dialog. Pure — the
7
+ * caller reads the return and focuses it. Exported for testing.
8
+ */
9
+ export declare function focusTrapTarget(items: HTMLElement[], active: HTMLElement | null, shiftKey: boolean): HTMLElement | null;
10
+ export interface ModalFocusOptions {
11
+ /** Move focus into the dialog on open. Default true. Set false when the
12
+ * modal manages its own initial focus (e.g. a specific field or button). */
13
+ autoFocus?: boolean;
14
+ /** Close on Escape via `onClose`. Default true. Set false when the modal has
15
+ * its own Escape handling (then `onClose` may be omitted). */
16
+ closeOnEscape?: boolean;
17
+ }
18
+ export declare function useModalFocus<T extends HTMLElement = HTMLDivElement>(onClose?: () => void, opts?: ModalFocusOptions): React.RefObject<T | null>;
@@ -0,0 +1,220 @@
1
+ import type { MoviePlayer } from './gifMovie';
2
+ import { OverlayLayerOrder } from '../layout/overlayLayerOrder';
3
+ export interface LabelCreateOptions {
4
+ /** Parent window id ('main' for main viewport). Defaults to 'main'. */
5
+ parent?: string;
6
+ x: number;
7
+ y: number;
8
+ width: number;
9
+ height: number;
10
+ /** Whether to draw the label's background fill. */
11
+ fillBackground: boolean;
12
+ /** Whether clicks pass through to whatever is underneath. */
13
+ clickThrough?: boolean;
14
+ }
15
+ export interface LabelState {
16
+ name: string;
17
+ parent: string;
18
+ x: number;
19
+ y: number;
20
+ width: number;
21
+ height: number;
22
+ fillBackground: boolean;
23
+ clickThrough: boolean;
24
+ visible: boolean;
25
+ /** Inner HTML content set via echo()/setLabelText. */
26
+ html: string;
27
+ /** rgba 0..255 channels; alpha defaults to 255 when set via setBackgroundColor. */
28
+ backgroundColor?: {
29
+ r: number;
30
+ g: number;
31
+ b: number;
32
+ a: number;
33
+ };
34
+ /** Mudlet setBackgroundImage(labelName, imageLocation) — resolved CSS URL.
35
+ * Labels have no `mode` (unlike consoles): Mudlet just calls
36
+ * `QLabel::setPixmap()`, which paints the image at its native pixel size
37
+ * (no scaling), left-aligned and vertically centered, clipped to the
38
+ * label's geometry. `width`/`height` are the image's resolved intrinsic
39
+ * size (filled in asynchronously for SVGs, which otherwise have no CSS
40
+ * intrinsic size — see backgroundImageSize.ts); until resolved, or for
41
+ * formats CSS already sizes natively, they're left unset. */
42
+ backgroundImage?: {
43
+ url: string;
44
+ width?: number;
45
+ height?: number;
46
+ };
47
+ /** Qt-style CSS string set via setLabelStyleSheet; parsed at render time. */
48
+ styleSheet?: string;
49
+ /** Sticky Qt `alignment` widget property, captured from a
50
+ * `qproperty-alignment` declaration in any setStyleSheet call. In Qt,
51
+ * qproperty-* declarations set the widget property permanently — a later
52
+ * setStyleSheet that omits it does NOT revert it (ordinary style is
53
+ * replaced wholesale, but the property sticks). So we track it separately
54
+ * from `styleSheet` and re-apply it at render. Raw Qt value, e.g.
55
+ * "AlignLeft | AlignTop"; translated by qtAlignmentToFlex at render. */
56
+ alignment?: string;
57
+ /** Sticky Qt `scaledContents` widget property, captured from a
58
+ * `qproperty-scaledContents` declaration in any setStyleSheet call. When
59
+ * true, Qt's QLabel::setScaledContents scales the pixmap
60
+ * (setBackgroundImage) to fill the entire label instead of painting it at
61
+ * native size; LabelOverlay maps that to `background-size: 100% 100%`. Like
62
+ * `alignment`, it's a widget property that persists across a later
63
+ * stylesheet that omits it. */
64
+ scaledContents?: boolean;
65
+ /** Mudlet setLinkStyle(labelName, linkColor, linkVisitedColor, underline) —
66
+ * styling for `<a>` links inside the label's HTML. Cleared by
67
+ * resetLinkStyle. Colors are any CSS color string (empty = leave default). */
68
+ linkStyle?: {
69
+ color?: string;
70
+ visitedColor?: string;
71
+ underline: boolean;
72
+ };
73
+ /** Click handler installed by setLabelClickCallback. The event table mirrors
74
+ * Mudlet's `mudlet.mouse_button` shape: `{button, x, y, alt, ctrl, shift, meta}`. */
75
+ onClick?: (event: LabelMouseEvent) => void;
76
+ /** Pointer down (Mudlet release callback fires on mouseup; press is implicit). */
77
+ onMouseDown?: (event: LabelMouseEvent) => void;
78
+ /** Pointer up — Mudlet setLabelReleaseCallback. */
79
+ onMouseUp?: (event: LabelMouseEvent) => void;
80
+ /** Double-click — Mudlet setLabelDoubleClickCallback. */
81
+ onDoubleClick?: (event: LabelMouseEvent) => void;
82
+ /** Pointer move — Mudlet setLabelMoveCallback. */
83
+ onMouseMove?: (event: LabelMouseEvent) => void;
84
+ /** Wheel — Mudlet setLabelWheelCallback. event.angleDelta carries the scroll. */
85
+ onWheel?: (event: LabelWheelEvent) => void;
86
+ /** Pointer enter — Mudlet setLabelOnEnter. */
87
+ onMouseEnter?: (event: LabelMouseEvent) => void;
88
+ /** Pointer leave — Mudlet setLabelOnLeave. */
89
+ onMouseLeave?: (event: LabelMouseEvent) => void;
90
+ /** Tooltip text rendered via the title attribute. */
91
+ tooltip?: string;
92
+ /** CSS cursor value (e.g. 'pointer', 'crosshair', 'none'). */
93
+ cursor?: string;
94
+ /** Animated GIF player installed by Mudlet's setMovie. Rendered as a
95
+ * <canvas> instead of the html content (QLabel shows one or the other). */
96
+ movie?: MoviePlayer;
97
+ }
98
+ /** Event payload for label mouse callbacks. `button` is the Qt button *name*
99
+ * Mudlet reports ("LeftButton" / "RightButton" / "MidButton" / "NoButton" / …),
100
+ * so ported Geyser scripts that branch on `event.button == "LeftButton"` work. */
101
+ export interface LabelMouseEvent {
102
+ button: string;
103
+ x: number;
104
+ y: number;
105
+ globalX: number;
106
+ globalY: number;
107
+ alt: boolean;
108
+ ctrl: boolean;
109
+ shift: boolean;
110
+ meta: boolean;
111
+ }
112
+ export interface LabelWheelEvent extends LabelMouseEvent {
113
+ /** Mudlet exposes wheel deltas via `angleDelta.x` / `angleDelta.y` (Qt naming). */
114
+ angleDelta: {
115
+ x: number;
116
+ y: number;
117
+ };
118
+ }
119
+ type Listener = (labels: LabelState[]) => void;
120
+ export declare class LabelManager {
121
+ readonly overlayZ: OverlayLayerOrder;
122
+ private readonly labels;
123
+ private readonly byParent;
124
+ private readonly listeners;
125
+ private indexAdd;
126
+ private indexRemove;
127
+ constructor(overlayZ?: OverlayLayerOrder);
128
+ /** Returns true if a new label was created. Mudlet's createLabel returns
129
+ * false when a label with the same name already exists. */
130
+ create(name: string, opts: LabelCreateOptions): boolean;
131
+ has(name: string): boolean;
132
+ /** Read-only handle on a label's stored state, for the geometry/visibility/
133
+ * text getters (getWindowGeometry, windowVisible, getLabelText). */
134
+ get(name: string): Readonly<LabelState> | undefined;
135
+ destroy(name: string): boolean;
136
+ move(name: string, x: number, y: number): boolean;
137
+ resize(name: string, width: number, height: number): boolean;
138
+ /** Mudlet setWindow — reparent a label into another window's overlay
139
+ * ('main', a userwindow / miniconsole id, or a scroll box name). Both
140
+ * the old and the new parent's overlays re-render. */
141
+ setParent(name: string, parent: string): boolean;
142
+ /** Mudlet `getLabelSizeHint(name)` → the label's preferred `{width,height}`.
143
+ * Mudlet returns the QLabel sizeHint (the size its content wants); the
144
+ * browser analogue is the rendered node's content extent
145
+ * (`scrollWidth`/`scrollHeight`), read off the `data-mudix-label` element.
146
+ * Falls back to the configured geometry when the label isn't in the DOM
147
+ * yet (hidden, or rendered before mount). null when no such label. */
148
+ getSizeHint(name: string): {
149
+ width: number;
150
+ height: number;
151
+ } | null;
152
+ show(name: string): boolean;
153
+ hide(name: string): boolean;
154
+ setHtml(name: string, html: string): boolean;
155
+ /** Mudlet setMovie — install (or replace) the label's GIF player. */
156
+ setMovie(name: string, player: MoviePlayer): boolean;
157
+ getMovie(name: string): MoviePlayer | null;
158
+ /** Mudlet scaleMovie — autoscale tracks the label size (CSS 100%);
159
+ * autoscale=false freezes the scale at the label's current geometry.
160
+ * False when the label has no movie (matches Mudlet's warning case). */
161
+ setMovieScale(name: string, autoscale: boolean): boolean;
162
+ setBackgroundColor(name: string, r: number, g: number, b: number, a?: number): boolean;
163
+ getBackgroundColor(name: string): {
164
+ r: number;
165
+ g: number;
166
+ b: number;
167
+ a: number;
168
+ } | null;
169
+ setBackgroundImage(name: string, url: string): boolean;
170
+ /** Fills in the intrinsic pixel size resolved asynchronously for `url`
171
+ * (see backgroundImageSize.ts). No-ops if the label's image has since
172
+ * changed away from `url` (stale resolution racing a newer call). */
173
+ setBackgroundImageSize(name: string, url: string, width: number, height: number): boolean;
174
+ resetBackgroundImage(name: string): boolean;
175
+ setStyleSheet(name: string, css: string): boolean;
176
+ /** Mudlet `setLinkStyle(labelName, linkColor, linkVisitedColor, underline)`. */
177
+ setLinkStyle(name: string, color: string, visitedColor: string, underline: boolean): boolean;
178
+ /** Mudlet `resetLinkStyle(labelName)` — drop any setLinkStyle override. */
179
+ resetLinkStyle(name: string): boolean;
180
+ /** Mudlet `getLabelStyleSheet(name)` — the Qt-style CSS last set via
181
+ * {@link setStyleSheet}, or `""` when none is set. Returns `undefined`
182
+ * when the label doesn't exist so the caller can distinguish that case. */
183
+ getStyleSheet(name: string): string | undefined;
184
+ setClickCallback(name: string, fn: ((e: LabelMouseEvent) => void) | undefined): boolean;
185
+ setMouseUpCallback(name: string, fn: ((e: LabelMouseEvent) => void) | undefined): boolean;
186
+ setDoubleClickCallback(name: string, fn: ((e: LabelMouseEvent) => void) | undefined): boolean;
187
+ setMouseMoveCallback(name: string, fn: ((e: LabelMouseEvent) => void) | undefined): boolean;
188
+ setWheelCallback(name: string, fn: ((e: LabelWheelEvent) => void) | undefined): boolean;
189
+ setMouseEnterCallback(name: string, fn: ((e: LabelMouseEvent) => void) | undefined): boolean;
190
+ setMouseLeaveCallback(name: string, fn: ((e: LabelMouseEvent) => void) | undefined): boolean;
191
+ setTooltip(name: string, text: string | undefined): boolean;
192
+ setClickThrough(name: string, value: boolean): boolean;
193
+ setCursor(name: string, cursor: string | undefined): boolean;
194
+ raise(name: string): boolean;
195
+ lower(name: string): boolean;
196
+ list(parent: string): LabelState[];
197
+ subscribe(parent: string, fn: Listener): () => void;
198
+ clearAll(): void;
199
+ /**
200
+ * Mark a parent's overlay dirty, flushed once on the next frame.
201
+ *
202
+ * A Geyser reflow re-issues moveWindow/resizeWindow for every widget in a
203
+ * subtree (Geyser.Container:reposition recurses into every child), and
204
+ * f2ce-tools' table resize walks every row and cell the same way. Notifying
205
+ * synchronously per call meant one overlay re-render per widget — hundreds
206
+ * of renders for a single layout pass. Qt has no equivalent cost, which is
207
+ * why the same package stays smooth in desktop Mudlet.
208
+ *
209
+ * The whole cascade is synchronous, so it collapses into one flush per
210
+ * parent afterwards. Listeners only ever saw the final state anyway — the
211
+ * intermediate values were never painted, being on the same blocked task.
212
+ * subscribe() keeps its synchronous first call so mounts stay immediate.
213
+ */
214
+ private dirty;
215
+ private flushScheduled;
216
+ private notify;
217
+ /** Immediate, uncoalesced notification for one parent. */
218
+ private flushParent;
219
+ }
220
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { LabelManager } from './LabelManager';
2
+ import './LabelOverlay.css';
3
+ export declare function domButtonToMudlet(type: string, domButton: number): string;
4
+ interface LabelOverlayProps {
5
+ manager: LabelManager;
6
+ parent: string;
7
+ }
8
+ export declare function LabelOverlay({ manager, parent }: LabelOverlayProps): import("react/jsx-runtime").JSX.Element | null;
9
+ export {};
@@ -0,0 +1,10 @@
1
+ export declare function resolveSvgIntrinsicSize(url: string): Promise<{
2
+ width: number;
3
+ height: number;
4
+ } | null>;
5
+ /** Exported for tests. Mirrors Qt's defaultSize(): explicit width+height
6
+ * wins, else the viewBox extent, else no intrinsic size (null). */
7
+ export declare function parseSvgIntrinsicSize(svgText: string): {
8
+ width: number;
9
+ height: number;
10
+ } | null;
@@ -0,0 +1,6 @@
1
+ export declare const QT_CURSOR_TO_CSS: Record<number, string>;
2
+ /** Reverse map of Mudlet's `mudlet.cursor` table (CursorShapes.lua). Used so
3
+ * setLabelCursor accepts the string name directly without requiring the
4
+ * bundled GUIUtils.lua wrapper to be loaded. -1 ('Reset') clears the cursor.
5
+ */
6
+ export declare const QT_CURSOR_NAME_TO_INT: Record<string, number>;
@@ -0,0 +1,100 @@
1
+ export interface GifFrame {
2
+ /** Full-canvas RGBA pixels, already composited (disposal applied).
3
+ * Explicitly ArrayBuffer-backed so it satisfies the ImageData ctor. */
4
+ pixels: Uint8ClampedArray<ArrayBuffer>;
5
+ /** Frame hold time in ms. Sub-2cs delays are bumped to 100ms, matching the
6
+ * de-facto browser behaviour for degenerate "0 delay" GIFs. */
7
+ delayMs: number;
8
+ }
9
+ export interface DecodedGif {
10
+ width: number;
11
+ height: number;
12
+ /** Total number of times the animation plays; Infinity for looping GIFs
13
+ * (NETSCAPE2.0 loop count 0). No extension → plays once, like QMovie. */
14
+ plays: number;
15
+ frames: GifFrame[];
16
+ }
17
+ /** Decode a GIF87a/GIF89a file into composited full frames. Throws on data
18
+ * that isn't a GIF or is structurally broken; tolerates a truncated tail the
19
+ * way browsers do (keeps the frames decoded so far). */
20
+ export declare function decodeGif(bytes: Uint8Array): DecodedGif;
21
+ /** How the movie canvas is sized inside its label — mirrors QMovie/QLabel:
22
+ * 'none' shows the GIF at native size; 'auto' tracks the label size (CSS
23
+ * 100%, so a label resize rescales for free — Mudlet's autoscale reconnect);
24
+ * 'fixed' is scaleMovie(name, false): scaled once to the size at call time. */
25
+ export type MovieScale = {
26
+ mode: 'none';
27
+ } | {
28
+ mode: 'auto';
29
+ } | {
30
+ mode: 'fixed';
31
+ width: number;
32
+ height: number;
33
+ };
34
+ /**
35
+ * Playback controller for one decoded GIF on one label. The React layer
36
+ * attaches/detaches the actual <canvas>; the player keeps ticking regardless
37
+ * (QMovie also runs while hidden) and repaints the current frame on attach.
38
+ */
39
+ export declare class MoviePlayer {
40
+ /** Consumed by the label renderer; set via LabelManager.setMovieScale so
41
+ * the overlay re-renders when it changes. */
42
+ scale: MovieScale;
43
+ private _gif;
44
+ private canvas;
45
+ private timer;
46
+ private frame;
47
+ private speedPct;
48
+ private playing;
49
+ /** start()/pause() intent, remembered separately from `playing` so a
50
+ * pending player (frames still decoding) knows whether to begin playback
51
+ * when resolveFrames delivers them. */
52
+ private wantsPlaying;
53
+ private playsLeft;
54
+ constructor(gif: DecodedGif);
55
+ /** A player whose frames arrive later via {@link resolveFrames} — used for
56
+ * the async ImageDecoder path (animated WebP / APNG) so setMovie can
57
+ * install the movie synchronously; dimensions come from the file header. */
58
+ static pending(width: number, height: number): MoviePlayer;
59
+ get gif(): DecodedGif;
60
+ get frameCount(): number;
61
+ get currentFrame(): number;
62
+ get isPlaying(): boolean;
63
+ get speed(): number;
64
+ /** Register the mounted canvas (null on unmount) and paint the current frame. */
65
+ attach(canvas: HTMLCanvasElement | null): void;
66
+ /** QMovie::start — begins/resumes playback; restarts when at the end. */
67
+ start(): void;
68
+ /** QMovie::setPaused(true) — stays on the current frame. */
69
+ pause(): void;
70
+ /** Deliver asynchronously-decoded frames to a {@link pending} player.
71
+ * Honors the intent expressed meanwhile: playback begins only if start()
72
+ * was called and no pause()/stop() followed it. */
73
+ resolveFrames(gif: DecodedGif): void;
74
+ /** Full teardown when the label goes away or the movie is replaced. */
75
+ stop(): void;
76
+ /** QMovie::jumpToFrame — 0-based; false when the frame doesn't exist. */
77
+ jumpToFrame(n: number): boolean;
78
+ /** QMovie::setSpeed — percent, 100 = recorded speed. <= 0 halts advancing
79
+ * (paused-in-place) until a positive speed is set again. */
80
+ setSpeed(percent: number): boolean;
81
+ private schedule;
82
+ private clearTimer;
83
+ private draw;
84
+ }
85
+ /** Whether the async decode path (animated WebP / APNG) exists in this
86
+ * browser. Firefox lacks ImageDecoder as of 2026 — GIFs still work there. */
87
+ export declare function supportsImageDecoder(): boolean;
88
+ /** Identify non-GIF bytes the ImageDecoder path accepts for setMovie:
89
+ * WebP (animated or static) and PNG (APNG or static). Returns the MIME type
90
+ * and the header-derived dimensions a pending player needs; null otherwise. */
91
+ export declare function sniffDecodableImage(bytes: Uint8Array): {
92
+ mime: 'image/png' | 'image/webp';
93
+ width: number;
94
+ height: number;
95
+ } | null;
96
+ /** Decode WebP/APNG through ImageDecoder into the DecodedGif shape. Each
97
+ * decoded VideoFrame is already fully composited (the decoder applies
98
+ * blending/disposal), so frames just need rasterizing to RGBA — done by
99
+ * drawing onto an OffscreenCanvas (available wherever ImageDecoder is). */
100
+ export declare function decodeAnimatedImage(bytes: Uint8Array, mime: string): Promise<DecodedGif>;