@wayward/types 2.11.5-beta.dev.20220306.2 → 2.11.5-beta.dev.20220309.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,7 +13,8 @@ import { EventBus } from "event/EventBuses";
13
13
  import type { Events, IEventEmitterHost, IEventEmitterHostClass } from "event/EventEmitter";
14
14
  declare type HostOrHostClass = IEventEmitterHost<any> | IEventEmitterHostClass<any>;
15
15
  declare type HostFromHostOrHostClass<H extends IEventEmitterHost<any> | IEventEmitterHostClass<any>> = H extends IEventEmitterHostClass<any> ? InstanceOf<H> : H;
16
- export declare type EmitterOrBus = EventBus | HostOrHostClass;
16
+ export declare type Emitter = HostOrHostClass & object;
17
+ export declare type EmitterOrBus = EventBus | Emitter;
17
18
  export declare type Event<E extends EmitterOrBus> = keyof Events<E extends EventBus ? EventBusHost<E> : E>;
18
19
  declare type ArgsOf<F> = ArgumentsOf<Extract<F, AnyFunction>>;
19
20
  declare type ReturnOf<F> = ReturnType<Extract<F, AnyFunction>>;
@@ -9,7 +9,7 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  import EventEmitter from "event/EventEmitter";
12
- import type { EmitterOrBus, Event, Handler } from "event/EventManager";
12
+ import type { Emitter, EmitterOrBus, Event, Handler } from "event/EventManager";
13
13
  import { InfoDisplayLevel } from "game/inspection/IInfoProvider";
14
14
  import type { InfoProviderContext } from "game/inspection/InfoProviderContext";
15
15
  import Component from "ui/component/Component";
@@ -96,6 +96,7 @@ export declare abstract class InfoProvider extends EventEmitter.Host<IInfoProvid
96
96
  * Note: Any existing initialized components will not be retroactively subscribed.
97
97
  */
98
98
  subscribeRefreshOn<E extends EmitterOrBus, K extends Event<E>>(emitterOrBus: E, ...events: K[]): this;
99
+ subscribeRefreshOn<E extends Emitter, K extends Event<E>>(emitter: WeakRef<E>, ...events: K[]): this;
99
100
  /**
100
101
  * Call when this info provider should be refreshed.
101
102
  */
@@ -12,6 +12,7 @@ import type { ISteamNetworkRelayStatus, SteamNetworkingConnectionState } from "@
12
12
  import type { IPlayOptions } from "game/IGame";
13
13
  import type { MultiplayerSyncCheckLevel, ServerInfo } from "multiplayer/IMultiplayer";
14
14
  export interface ISteamworksEvents {
15
+ batteryChange(): any;
15
16
  overlayShown(): any;
16
17
  overlayHidden(): any;
17
18
  onRelayNetworkStatus(ready: boolean, status: ISteamNetworkRelayStatus): void;
@@ -19,6 +19,7 @@ export default class Steamworks extends EventEmitter.Host<ISteamworksEvents> {
19
19
  private buildTime;
20
20
  private overlayWorks;
21
21
  private runningOnSteamDeck;
22
+ private runningOnBatteryPower;
22
23
  private floatingTextInputFocused;
23
24
  private floatingTextInputBlurTime;
24
25
  private initializingMods;
@@ -47,6 +48,7 @@ export default class Steamworks extends EventEmitter.Host<ISteamworksEvents> {
47
48
  private _intervalIds;
48
49
  get isGameOverlayActive(): boolean;
49
50
  get isRunningOnSteamDeck(): boolean;
51
+ get isRunningOnBatteryPower(): boolean;
50
52
  isElectron(): boolean;
51
53
  reload(): Promise<void>;
52
54
  openGpuInfoWindow(): void;
@@ -86,6 +86,7 @@ export declare class Ui extends EventEmitter.Host<IUiEvents> {
86
86
  updateFontStyle(): void;
87
87
  updateUIAnimations(): void;
88
88
  updateUIOpacity(): void;
89
+ updatePowerMode(): void;
89
90
  toggleDeveloperMode(enabled: boolean): this;
90
91
  protected onGlobalSlotLoaded(): void;
91
92
  protected onPlay(): void;
@@ -18,11 +18,18 @@ import type { IStringSection } from "utilities/string/Interpolator";
18
18
  export interface IStatDisplayDescription extends IModdable {
19
19
  imagePath?: string | ((entity: Entity, stat: IStat) => string);
20
20
  /**
21
- * Defaults to `#ffffff`
21
+ * The CSS variable to use for the stat bar color
22
+ * Defaults to white
22
23
  */
23
24
  color?: string | ((entity: Entity, stat: IStat) => string);
24
25
  /**
25
- * Defaults to `#000000`
26
+ * The CSS variable to use for the stat bar color in RGB format
27
+ * Defaults to white
28
+ */
29
+ rgbColor?: string | ((entity: Entity, stat: IStat) => string);
30
+ /**
31
+ * The CSS variable to use for the background of the stat bar
32
+ * Defaults to black
26
33
  */
27
34
  darkColor?: string | ((entity: Entity, stat: IStat) => string);
28
35
  /**
@@ -36,7 +36,7 @@ export declare abstract class StatElement extends Component {
36
36
  /**
37
37
  * Returns the color of this stat.
38
38
  */
39
- getStatColor(dark?: boolean): string;
39
+ getStatColor(type?: "dark" | "rgb"): string;
40
40
  /**
41
41
  * Returns the formatted CSS url for the stat icon.
42
42
  */
@@ -26,7 +26,7 @@ export default class ScaleManager {
26
26
  /**
27
27
  * Returns the currently "requested" UI scale.
28
28
  */
29
- getUserSetting(): number;
29
+ getUserSetting(scale?: number): number;
30
30
  /**
31
31
  * Requests a new UI scale, a multiplier of the default size.
32
32
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wayward/types",
3
3
  "description": "TypeScript declarations for Wayward, used for modding.",
4
- "version": "2.11.5-beta.dev.20220306.2",
4
+ "version": "2.11.5-beta.dev.20220309.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",