@mafiahub/types 0.1.8 → 0.1.10

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.
@@ -0,0 +1,11 @@
1
+ /** Runtime-side flags. Available on server and client. */
2
+ declare const ExecutionEnvironment: {
3
+ /** True in the sandboxed client scripting runtime. */
4
+ readonly isClient: boolean;
5
+ /** True in the authoritative server scripting runtime. */
6
+ readonly isServer: boolean;
7
+ /** Local Framework release version. */
8
+ readonly frameworkVersion: string;
9
+ /** Local mod version from InstanceOptions.modVersion; empty when unset. */
10
+ readonly modVersion: string;
11
+ };
@@ -17,6 +17,9 @@
17
17
  * - Numpad `numpad0`–`numpad9` (aliases `num0`–`num9`)
18
18
  * - Mouse `mouse1` (left) `mouse2` (right) `mouse3` (middle) `mouse4` `mouse5`
19
19
  *
20
+ * Letters and digits identify physical positions on a US keyboard. Use
21
+ * `getLabel` to show the corresponding label in the player's current layout.
22
+ *
20
23
  * @example
21
24
  * // Toggle a HUD on key-down:
22
25
  * Key.bind("f6", "down", () => toggleHud());
@@ -52,4 +55,17 @@ declare const Key: {
52
55
  * game window is in the background (same gate as bind dispatch).
53
56
  */
54
57
  isDown(key: string): boolean;
58
+
59
+ /**
60
+ * Display label for a physical key using the current keyboard layout.
61
+ * For example, `getLabel("y")` returns `"Z"` on German QWERTZ.
62
+ * Works while menus/web views own input and without registering a binding.
63
+ * Query again when refreshing a prompt so layout changes are reflected.
64
+ * Labels are display text; keep using the original key name for bindings.
65
+ * @returns Uppercase printable text, or an English name such as `"Enter"`
66
+ * or `"Mouse 1"`. Falls back to the uppercase canonical key name if the
67
+ * layout cannot translate it. Ignores held modifiers and Caps Lock.
68
+ * @throws If the key is unknown or the argument is not a string.
69
+ */
70
+ getLabel(key: string): string;
55
71
  };
package/index.d.ts CHANGED
@@ -9,3 +9,4 @@
9
9
  /// <reference path="framework/exports.d.ts" />
10
10
  /// <reference path="framework/key.d.ts" />
11
11
  /// <reference path="framework/discord.d.ts" />
12
+ /// <reference path="framework/execution_environment.d.ts" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mafiahub/types",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "TypeScript type definitions for the MafiaHub Framework scripting API",
5
5
  "types": "index.d.ts",
6
6
  "files": [