@wayward/types 2.14.0-beta.dev.20240917.1 → 2.14.0-beta.dev.20240918.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.
@@ -21,6 +21,7 @@ export default abstract class InspectionsHandler extends EventEmitter.Host<IInsp
21
21
  protected readonly context: InfoProviderContext;
22
22
  protected readonly inspectionsMap: Map<InspectType, HashSet<Inspection<any>>>;
23
23
  static makeInspectionsSet(...values: Array<IterableOr<Inspection<any> | undefined>>): HashSet<Inspection<any>>;
24
+ protected registered: boolean;
24
25
  constructor(context: InfoProviderContext, inspectionsMap?: Map<InspectType, HashSet<Inspection<any>>>);
25
26
  get<TYPE extends InspectType>(inspectType: InspectType): HashSet<ResolvedInspection<TYPE>> | undefined;
26
27
  set(inspectType: InspectType, inspections: HashSet<Inspection<any>>): Map<InspectType, HashSet<Inspection<any>>>;
@@ -16,10 +16,11 @@ import type { Events } from "@wayward/utilities/event/EventEmitter";
16
16
  import EventEmitter from "@wayward/utilities/event/EventEmitter";
17
17
  import type Log from "@wayward/utilities/Log";
18
18
  export declare enum ModRegistrationTime {
19
- Setup = 0,
20
- Initialize = 1,
21
- Load = 2,
22
- All = 3
19
+ Setup = 1,
20
+ Initialize = 2,
21
+ Load = 4,
22
+ All = 7,
23
+ Reinitialize = 10
23
24
  }
24
25
  export interface IRegistry {
25
26
  [SYMBOL_MOD_REGISTRATIONS]: ModRegistration[];
@@ -83,6 +84,7 @@ export declare abstract class BaseMod extends EventEmitter.Host<IModEvents> {
83
84
  * Handles registration of fields decorated with ` @Register.thing`, which occur at `ModRegistrationTime.Initialize`
84
85
  */
85
86
  private onBeforeInitialize;
87
+ private onBeforeReinitialize;
86
88
  protected registerEventHandlersOnPreLoad: boolean;
87
89
  /**
88
90
  * Event handler for `ModEvent.PreLoad`.
@@ -42,6 +42,7 @@ export default abstract class InspectionsList<INSPECTIONS_HANDLER extends Inspec
42
42
  deregister(): void;
43
43
  setDisplayLevel(displayLevel: InfoDisplayLevel): this;
44
44
  refresh(): this;
45
+ private refreshAsync;
45
46
  protected abstract initializeInspections(): INSPECTIONS_HANDLER | undefined;
46
47
  isValid?(): boolean;
47
48
  protected getInvalidTranslation?(): TranslationGenerator | undefined;
@@ -9,8 +9,6 @@
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
11
  export type Awaited<T> = T extends PromiseLike<infer U> ? Awaited<U> : T;
12
- export declare function yieldTask(): Promise<void>;
13
- export declare function postTask<T>(callback: () => Promise<T>, priority: "user-blocking" | "user-visible" | "background"): Promise<T>;
14
12
  /**
15
13
  * Create a promise that will resolve after `ms`.
16
14
  * @param ms The time in milliseconds until the promise will resolve.
@@ -0,0 +1,9 @@
1
+ export default class Task {
2
+ private readonly interval;
3
+ static yield(quick?: boolean): Promise<void>;
4
+ static post<T>(callback: () => Promise<T>, priority: "user-blocking" | "user-visible" | "background"): Promise<T>;
5
+ private lastYieldEnd;
6
+ constructor(interval?: number);
7
+ reset(): void;
8
+ yield(quick?: boolean): Promise<void>;
9
+ }
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.14.0-beta.dev.20240917.1",
4
+ "version": "2.14.0-beta.dev.20240918.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",