@scml-dol-maplebirch/types 4.4.1 → 5.0.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.
package/maplebirch.d.ts CHANGED
@@ -1,10 +1,4 @@
1
1
  import { Passage } from '@scml/types/sugarcube-2-ModLoader/SugarCube2';
2
- import { ModBootJson, ModInfo } from '@scml/types/sugarcube-2-ModLoader/ModLoader';
3
- import { InputFileFormat, JSZipLikeReadOnlyInterface } from '@scml/types/sugarcube-2-ModLoader/JSZipLikeReadOnlyInterface';
4
- import { ModZipReader } from '@scml/types/sugarcube-2-ModLoader/ModZipReader';
5
- import { SC2DataManager } from '@scml/types/sugarcube-2-ModLoader/SC2DataManager';
6
- import { WikifyTracerCallback } from '@scml/types/sugarcube-2-ModLoader/WikifyTracer';
7
- import { ModUtils } from '@scml/types/sugarcube-2-ModLoader/Utils';
8
2
  import { BrowserAPI } from '@scml/sc2-verlnir/src/browser';
9
3
  import { ConfigAPI } from '@scml/sc2-verlnir/src/config';
10
4
  import { DebugBarAPI } from '@scml/sc2-verlnir/src/debugbar';
@@ -28,13 +22,124 @@ import { VersionInfo } from '@scml/sc2-verlnir/src/version';
28
22
  import { VisibilityAPI } from '@scml/sc2-verlnir/src/visibility';
29
23
  import { WikifierAPI } from '@scml/sc2-verlnir/src/wikifier';
30
24
  import { SugarCubeStoryVariables, SugarCubeTemporaryVariables } from 'twine-sugarcube/userdata';
25
+ import { SC2DataManager } from '@scml/types/sugarcube-2-ModLoader/SC2DataManager';
26
+ import { WikifyTracerCallback } from '@scml/types/sugarcube-2-ModLoader/WikifyTracer';
31
27
  import { Gui } from '@scml/types/Mod_LoaderGui/Gui';
32
- import jsyaml from 'js-yaml';
33
- import { Howl, Howler } from 'howler';
34
28
  import * as marked from 'marked';
29
+ import jsyaml from 'js-yaml';
30
+ import { Howl, HowlOptions } from 'howler';
31
+ import { InputFileFormat, JSZipLikeReadOnlyInterface } from '@scml/types/sugarcube-2-ModLoader/JSZipLikeReadOnlyInterface';
32
+ import { ModBootJson, ModInfo } from '@scml/types/sugarcube-2-ModLoader/ModLoader';
33
+ import { ModZipReader } from '@scml/types/sugarcube-2-ModLoader/ModZipReader';
34
+ import { ModUtils } from '@scml/types/sugarcube-2-ModLoader/Utils';
35
35
  import { MacroContext } from 'twine-sugarcube';
36
36
  //#endregion
37
- //#region src/modules/Frameworks/Patches/Bodywriting.d.ts
37
+ //#region src/utils/object.d.ts
38
+ type MergeMode = 'replace' | 'concat' | 'merge';
39
+ type MergeFilterFn = (key: string, value: unknown, depth: number, targetValue: unknown) => boolean;
40
+ type MergeTuple<T extends readonly unknown[], S extends readonly unknown[]> = S extends readonly [infer Head, ...infer Rest]
41
+ ? T extends readonly [infer Previous, ...infer Tail]
42
+ ? [Merged<Previous, Head, 'merge'>, ...MergeTuple<Tail, Rest>]
43
+ : [...S]
44
+ : [...T];
45
+ type Merged<T, S, Mode extends MergeMode> = S extends readonly unknown[]
46
+ ? T extends readonly unknown[]
47
+ ? Mode extends 'replace'
48
+ ? [...S]
49
+ : Mode extends 'concat'
50
+ ? [...T, ...S]
51
+ : number extends T['length'] | S['length']
52
+ ? (T[number] | S[number])[]
53
+ : MergeTuple<T, S>
54
+ : [...S]
55
+ : S extends Record<string, unknown>
56
+ ? Omit<T, keyof S> & { [Key in keyof S]: Key extends keyof T ? Merged<T[Key], S[Key], Mode> : S[Key] }
57
+ : S;
58
+ type MergeResult<T, Sources extends readonly unknown[], Mode extends MergeMode = 'merge'> = Sources extends readonly [infer Source, ...infer Rest]
59
+ ? MergeResult<Merged<T, Source, Mode>, Rest, Mode>
60
+ : T;
61
+ declare function clone<T>(source: T, deep?: boolean, proto?: boolean, map?: WeakMap<object, unknown>): T;
62
+ declare function equal(a: unknown, b: unknown): boolean;
63
+ declare function merge<T, Sources extends unknown[]>(target: T, ...sources: Sources): MergeResult<T, Sources>;
64
+ declare function append<T, Sources extends unknown[]>(target: T, ...sources: Sources): MergeResult<T, Sources, 'concat'>;
65
+ declare function cover<T, Sources extends unknown[]>(target: T, ...sources: Sources): MergeResult<T, Sources, 'replace'>;
66
+ declare function mergeFn<T, Sources extends unknown[]>(target: T, filter: MergeFilterFn | null, ...sources: Sources): MergeResult<T, Sources>;
67
+ declare function appendFn<T, Sources extends unknown[]>(target: T, filter: MergeFilterFn | null, ...sources: Sources): MergeResult<T, Sources, 'concat'>;
68
+ declare function coverFn<T, Sources extends unknown[]>(target: T, filter: MergeFilterFn | null, ...sources: Sources): MergeResult<T, Sources, 'replace'>;
69
+ //#endregion
70
+ //#region src/utils/array.d.ts
71
+ type ContainsMode = 'all' | 'any' | 'none';
72
+ type ContainsOptions = {
73
+ case?: boolean;
74
+ compare?: (item: unknown, value: unknown) => boolean;
75
+ deep?: boolean;
76
+ };
77
+ declare function contains(array: readonly unknown[], value: unknown, mode?: ContainsMode, options?: ContainsOptions): boolean;
78
+ declare function randomNumber(min?: number, max?: number, float?: boolean): number;
79
+ declare function randomPick<T>(items: readonly T[], weights?: readonly number[] | null, allowNull?: boolean): T | null | undefined;
80
+ declare function clamp(value: unknown, min: number, max: number, fallback?: number): number;
81
+ //#endregion
82
+ //#region src/utils/string.d.ts
83
+ type ConvertMode$1 = 'lower' | 'upper' | 'capitalize' | 'title' | 'camel' | 'pascal' | 'snake' | 'kebab' | 'constant';
84
+ declare function convert(
85
+ value: string,
86
+ mode?: ConvertMode$1,
87
+ options?: {
88
+ delimiter?: string;
89
+ acronym?: boolean;
90
+ }
91
+ ): string;
92
+ declare function escapeHtmlText(value: string): string;
93
+ declare function widgets(content: string): string;
94
+ declare function widgets(...contents: string[]): string[];
95
+ //#endregion
96
+ //#region src/compat/Prototype.d.ts
97
+ declare global {
98
+ interface ObjectConstructor {
99
+ merge<T extends object = Record<string, unknown>>(...sources: unknown[]): T;
100
+ append<T extends object = Record<string, unknown>>(...sources: unknown[]): T;
101
+ cover<T extends object = Record<string, unknown>>(...sources: unknown[]): T;
102
+ mergefn<T extends object = Record<string, unknown>>(filterFn: MergeFilterFn | null, ...sources: unknown[]): T;
103
+ appendfn<T extends object = Record<string, unknown>>(filterFn: MergeFilterFn | null, ...sources: unknown[]): T;
104
+ coverfn<T extends object = Record<string, unknown>>(filterFn: MergeFilterFn | null, ...sources: unknown[]): T;
105
+ }
106
+ interface Array<T> {
107
+ contains(value: unknown, mode?: ContainsMode, options?: ContainsOptions): boolean;
108
+ either(weights?: number[], allowNull?: boolean): T | null | undefined;
109
+ }
110
+ interface ArrayConstructor {
111
+ merge<T>(...sources: readonly T[][]): T[];
112
+ append<T>(...sources: readonly T[][]): T[];
113
+ cover<T>(...sources: readonly T[][]): T[];
114
+ }
115
+ interface ReadonlyArray<T> {
116
+ contains(value: unknown, mode?: ContainsMode, options?: ContainsOptions): boolean;
117
+ either(weights?: number[], allowNull?: boolean): T | null | undefined;
118
+ }
119
+ interface String {
120
+ contains(
121
+ value: string,
122
+ options?: {
123
+ case?: boolean;
124
+ }
125
+ ): boolean;
126
+ convert(
127
+ mode?: ConvertMode$1,
128
+ options?: {
129
+ delimiter?: string;
130
+ acronym?: boolean;
131
+ }
132
+ ): string;
133
+ }
134
+ interface Math {
135
+ random(): number;
136
+ random(max: number): number;
137
+ random(min: number, max: number, float?: boolean): number;
138
+ clamp(value: unknown, min: number, max: number, fallback?: number): number;
139
+ }
140
+ }
141
+ //#endregion
142
+ //#region src/modules/DoL/Patches/Bodywriting.d.ts
38
143
  interface BodywritingConfig {
39
144
  writing?: string;
40
145
  writ_cn?: string;
@@ -69,7 +174,7 @@ declare class Bodywriting {
69
174
  private static set;
70
175
  }
71
176
  //#endregion
72
- //#region src/modules/Frameworks/Patches/Foodstuff.d.ts
177
+ //#region src/modules/DoL/Patches/Foodstuff.d.ts
73
178
  type FoodstuffSeason = 'spring' | 'summer' | 'autumn' | 'winter';
74
179
  type FoodstuffPlantingBed = 'earth' | 'water';
75
180
  type FoodstuffStallSize = 'small' | 'large';
@@ -133,7 +238,7 @@ declare class Foodstuff {
133
238
  private static ensureState;
134
239
  }
135
240
  //#endregion
136
- //#region src/modules/Frameworks/Patches/Location.d.ts
241
+ //#region src/modules/DoL/Patches/Location.d.ts
137
242
  interface LocationConfigOptions {
138
243
  overwrite?: boolean;
139
244
  layer?: string;
@@ -169,7 +274,7 @@ declare class Location {
169
274
  static apply(): void;
170
275
  }
171
276
  //#endregion
172
- //#region src/modules/Frameworks/Patches/Fishing.d.ts
277
+ //#region src/modules/DoL/Patches/Fishing.d.ts
173
278
  type FishingLocation = 'fishingBeach' | 'fishingPier' | 'fishingCoastPath' | 'fishingForestLake' | 'fishingMoor';
174
279
  type FishingSeason = 'spring' | 'summer' | 'autumn' | 'winter';
175
280
  type FishBehavior = 'runner' | 'darter' | 'panicked' | 'anchor' | 'thrasher' | 'slipper';
@@ -199,7 +304,7 @@ declare class Fishing {
199
304
  static apply(): void;
200
305
  }
201
306
  //#endregion
202
- //#region src/modules/Frameworks/Patches/Antiques.d.ts
307
+ //#region src/modules/DoL/Patches/Antiques.d.ts
203
308
  interface AntiqueConfig {
204
309
  hint: string;
205
310
  museum: string;
@@ -216,7 +321,7 @@ declare class Antiques {
216
321
  static syncState(): void;
217
322
  }
218
323
  //#endregion
219
- //#region src/modules/Frameworks/Patches/Traits.d.ts
324
+ //#region src/modules/DoL/Patches/Traits.d.ts
220
325
  interface TraitCategory {
221
326
  title: string;
222
327
  traits: Trait[];
@@ -682,76 +787,6 @@ declare global {
682
787
  }
683
788
  }
684
789
  //#endregion
685
- //#region src/constants.d.ts
686
- type LanguageCode = (typeof Languages)[number];
687
- declare const Languages: readonly ['EN', 'CN'];
688
- declare enum ModuleState {
689
- REGISTERED = 0,
690
- MOUNTED = 1,
691
- ERROR = 2,
692
- EXPOSED = 3,
693
- DISABLED = 4
694
- }
695
- //#endregion
696
- //#region src/utils/object.d.ts
697
- type MergeMode = 'replace' | 'concat' | 'merge';
698
- type MergeFilterFn = (key: string, value: unknown, depth: number, targetValue: unknown) => boolean;
699
- type MergeTuple<T extends readonly unknown[], S extends readonly unknown[]> = S extends readonly [infer Head, ...infer Rest]
700
- ? T extends readonly [infer Previous, ...infer Tail]
701
- ? [Merged<Previous, Head, 'merge'>, ...MergeTuple<Tail, Rest>]
702
- : [...S]
703
- : [...T];
704
- type Merged<T, S, Mode extends MergeMode> = S extends readonly unknown[]
705
- ? T extends readonly unknown[]
706
- ? Mode extends 'replace'
707
- ? [...S]
708
- : Mode extends 'concat'
709
- ? [...T, ...S]
710
- : number extends T['length'] | S['length']
711
- ? (T[number] | S[number])[]
712
- : MergeTuple<T, S>
713
- : [...S]
714
- : S extends Record<string, unknown>
715
- ? Omit<T, keyof S> & { [Key in keyof S]: Key extends keyof T ? Merged<T[Key], S[Key], Mode> : S[Key] }
716
- : S;
717
- type MergeResult<T, Sources extends readonly unknown[], Mode extends MergeMode = 'merge'> = Sources extends readonly [infer Source, ...infer Rest]
718
- ? MergeResult<Merged<T, Source, Mode>, Rest, Mode>
719
- : T;
720
- declare function clone<T>(source: T, deep?: boolean, proto?: boolean, map?: WeakMap<object, unknown>): T;
721
- declare function equal(a: unknown, b: unknown): boolean;
722
- declare function merge<T, Sources extends unknown[]>(target: T, ...sources: Sources): MergeResult<T, Sources>;
723
- declare function append<T, Sources extends unknown[]>(target: T, ...sources: Sources): MergeResult<T, Sources, 'concat'>;
724
- declare function cover<T, Sources extends unknown[]>(target: T, ...sources: Sources): MergeResult<T, Sources, 'replace'>;
725
- declare function mergeFn<T, Sources extends unknown[]>(target: T, filter: MergeFilterFn | null, ...sources: Sources): MergeResult<T, Sources>;
726
- declare function appendFn<T, Sources extends unknown[]>(target: T, filter: MergeFilterFn | null, ...sources: Sources): MergeResult<T, Sources, 'concat'>;
727
- declare function coverFn<T, Sources extends unknown[]>(target: T, filter: MergeFilterFn | null, ...sources: Sources): MergeResult<T, Sources, 'replace'>;
728
- //#endregion
729
- //#region src/utils/array.d.ts
730
- type ContainsMode = 'all' | 'any' | 'none';
731
- type ContainsOptions = {
732
- case?: boolean;
733
- compare?: (item: unknown, value: unknown) => boolean;
734
- deep?: boolean;
735
- };
736
- declare function contains(array: readonly unknown[], value: unknown, mode?: ContainsMode, options?: ContainsOptions): boolean;
737
- declare function randomNumber(min?: number, max?: number, float?: boolean): number;
738
- declare function randomPick<T>(items: readonly T[], weights?: readonly number[] | null, allowNull?: boolean): T | null | undefined;
739
- declare function clamp(value: unknown, min: number, max: number, fallback?: number): number;
740
- //#endregion
741
- //#region src/utils/string.d.ts
742
- type ConvertMode$1 = 'lower' | 'upper' | 'capitalize' | 'title' | 'camel' | 'pascal' | 'snake' | 'kebab' | 'constant';
743
- declare function convert(
744
- value: string,
745
- mode?: ConvertMode$1,
746
- options?: {
747
- delimiter?: string;
748
- acronym?: boolean;
749
- }
750
- ): string;
751
- declare function escapeHtmlText(value: string): string;
752
- declare function widgets(content: string): string;
753
- declare function widgets(...contents: string[]): string[];
754
- //#endregion
755
790
  //#region src/utils/binary.d.ts
756
791
  declare function textToBytes(value: string): Uint8Array;
757
792
  declare function jsonToBytes(value: unknown): Uint8Array;
@@ -762,12 +797,6 @@ declare function base64ToBytes(value: string): Uint8Array;
762
797
  declare function base64ToArrayBuffer(value: string): ArrayBuffer;
763
798
  declare function basicAuth(username: string, password: string): string;
764
799
  //#endregion
765
- //#region src/utils/path.d.ts
766
- declare function joinEncodedPath(...parts: string[]): string;
767
- //#endregion
768
- //#region src/utils/error.d.ts
769
- declare function errorMessage(error: unknown): string;
770
- //#endregion
771
800
  //#region src/utils/selector.d.ts
772
801
  type Comparator = '<' | '<=' | '>' | '>=';
773
802
  type ResultValue<Input, Result, Meta> = Result | ((input: Input, meta: Meta) => Result);
@@ -788,56 +817,6 @@ declare class SelectCase<Input = unknown, Result = unknown, Meta = Record<string
788
817
  private resolve;
789
818
  private validateType;
790
819
  }
791
- //#endregion
792
- //#region src/utils/image.d.ts
793
- declare function loadImage(src: string): string | false | Promise<string | false>;
794
- //#endregion
795
- //#region src/utils/prototype.d.ts
796
- declare global {
797
- interface ObjectConstructor {
798
- merge<T extends object = Record<string, unknown>>(...sources: unknown[]): T;
799
- append<T extends object = Record<string, unknown>>(...sources: unknown[]): T;
800
- cover<T extends object = Record<string, unknown>>(...sources: unknown[]): T;
801
- mergefn<T extends object = Record<string, unknown>>(filterFn: MergeFilterFn | null, ...sources: unknown[]): T;
802
- appendfn<T extends object = Record<string, unknown>>(filterFn: MergeFilterFn | null, ...sources: unknown[]): T;
803
- coverfn<T extends object = Record<string, unknown>>(filterFn: MergeFilterFn | null, ...sources: unknown[]): T;
804
- }
805
- interface Array<T> {
806
- contains(value: unknown, mode?: ContainsMode, options?: ContainsOptions): boolean;
807
- either(weights?: number[], allowNull?: boolean): T | null | undefined;
808
- }
809
- interface ArrayConstructor {
810
- merge<T>(...sources: readonly T[][]): T[];
811
- append<T>(...sources: readonly T[][]): T[];
812
- cover<T>(...sources: readonly T[][]): T[];
813
- }
814
- interface ReadonlyArray<T> {
815
- contains(value: unknown, mode?: ContainsMode, options?: ContainsOptions): boolean;
816
- either(weights?: number[], allowNull?: boolean): T | null | undefined;
817
- }
818
- interface String {
819
- contains(
820
- value: string,
821
- options?: {
822
- case?: boolean;
823
- }
824
- ): boolean;
825
- convert(
826
- mode?: ConvertMode$1,
827
- options?: {
828
- delimiter?: string;
829
- acronym?: boolean;
830
- }
831
- ): string;
832
- }
833
- interface Math {
834
- random(): number;
835
- random(max: number): number;
836
- random(min: number, max: number, float?: boolean): number;
837
- clamp(value: unknown, min: number, max: number, fallback?: number): number;
838
- }
839
- }
840
- declare function prototypeUtils(): void;
841
820
  declare namespace index_d_exports {
842
821
  export {
843
822
  SelectCase,
@@ -856,14 +835,10 @@ declare namespace index_d_exports {
856
835
  coverFn as coverfn,
857
836
  randomPick as either,
858
837
  equal,
859
- errorMessage,
860
838
  escapeHtmlText,
861
- joinEncodedPath,
862
839
  jsonToBytes,
863
- loadImage,
864
840
  merge,
865
841
  mergeFn as mergefn,
866
- prototypeUtils,
867
842
  publicUtils,
868
843
  randomNumber as random,
869
844
  textToBytes,
@@ -886,42 +861,157 @@ declare const publicUtils: Readonly<{
886
861
  SelectCase: typeof SelectCase;
887
862
  convert: typeof convert;
888
863
  clamp: typeof clamp;
889
- loadImage: typeof loadImage;
890
864
  }>;
891
865
  //#endregion
892
- //#region src/services/Logger.d.ts
893
- declare class Logger {
894
- readonly core: MaplebirchCore;
866
+ //#region src/infra/Logger.d.ts
867
+ type LogLevel = 'DEBUG' | 'INFO' | 'WARN' | 'ERROR';
868
+ export declare class Logger {
869
+ readonly modloader?: ModLoader | undefined;
895
870
  private static readonly LEVELS;
896
871
  private static readonly CONFIG;
897
- private level;
898
- constructor(core: MaplebirchCore);
899
- fromIDB(): Promise<void>;
872
+ private static readonly FORWARD;
873
+ private static level;
874
+ constructor(modloader?: ModLoader | undefined);
875
+ static toLevel(level: string | number): LogLevel;
900
876
  log(message: string, levelName?: string | number, ...objects: unknown[]): void;
901
877
  set LevelName(levelName: string);
902
878
  get LevelName(): string;
903
879
  }
904
880
  //#endregion
905
- //#region src/services/EventEmitter.d.ts
906
- type EventCallback<Args extends unknown[] = unknown[]> = (...args: Args) => unknown;
907
- declare class EventEmitter {
908
- readonly core: MaplebirchCore;
909
- private readonly events;
910
- private readonly afters;
911
- private readonly triggering;
912
- private readonly stickyEvents;
913
- private readonly stickyArgs;
914
- private readonly synchronousEvents;
915
- constructor(core: MaplebirchCore);
916
- on<Args extends unknown[]>(eventName: string, callback: EventCallback<Args>, description?: string): boolean;
917
- off<Args extends unknown[]>(eventName: string, identifier: EventCallback<Args> | string): boolean;
918
- once<Args extends unknown[]>(eventName: string, callback: EventCallback<Args>, description?: string): boolean;
919
- trigger(eventName: string, ...args: unknown[]): Promise<void>;
920
- after<Args extends unknown[]>(eventName: string, callback: EventCallback<Args>): void;
921
- private pending;
922
- private callSticky;
881
+ //#region src/infra/Diagnostics.d.ts
882
+ interface DiagnosticRecord {
883
+ at: string;
884
+ level: LogLevel;
885
+ scope?: string;
886
+ message: string;
887
+ data?: unknown;
923
888
  }
924
- //#endregion
889
+ interface PatchResult {
890
+ kind: 'passage' | 'script' | 'style' | 'source';
891
+ target: string;
892
+ index: number;
893
+ pattern: string;
894
+ matches: number;
895
+ applied: number;
896
+ status: 'applied' | 'unmatched' | 'missing' | 'invalid' | 'mismatch' | 'error';
897
+ expected?: number;
898
+ error?: string;
899
+ }
900
+ interface ModConflict {
901
+ source: string;
902
+ dataSource: string;
903
+ passages: string[];
904
+ scripts: string[];
905
+ styles: string[];
906
+ }
907
+ type ScopedLog = (message: string, level?: string, ...objects: unknown[]) => void;
908
+ export declare class Diagnostics extends Logger {
909
+ readonly scope: string;
910
+ private static readonly entries;
911
+ private static readonly patchResults;
912
+ constructor(modloader?: ModLoader, scope?: string);
913
+ static message(error: unknown): string;
914
+ log(message: string, levelName?: string | number, ...objects: unknown[]): void;
915
+ record(message: string, level?: string, scope?: string, ...objects: unknown[]): void;
916
+ write(message: string, level?: string, scope?: string, ...objects: unknown[]): void;
917
+ scoped(scope: string): ScopedLog;
918
+ get history(): readonly DiagnosticRecord[];
919
+ get errors(): DiagnosticRecord[];
920
+ get patches(): PatchResult[];
921
+ recordPatch(result: PatchResult): void;
922
+ clearPatches(): void;
923
+ get conflicts(): ModConflict[] | undefined;
924
+ export(): string;
925
+ reset(): void;
926
+ }
927
+ //#endregion
928
+ //#region src/host/Resources.d.ts
929
+ type ImageResult = string | false;
930
+ declare class Resources {
931
+ private readonly manager;
932
+ private readonly report;
933
+ private readonly cache;
934
+ private readonly pending;
935
+ constructor(manager: SC2DataManager, report: (path: string, error: unknown) => void);
936
+ normalize(path: string): string;
937
+ has(path: string): boolean | undefined;
938
+ load(path: string): ImageResult | Promise<ImageResult>;
939
+ clear(path?: string): void;
940
+ private resolve;
941
+ }
942
+ //#endregion
943
+ //#region src/host/ModLoader.d.ts
944
+ type Replacement = [RegExp, string];
945
+ type TwineAssetMode = 'append' | 'replace' | 'patch';
946
+ interface SourcePatch {
947
+ src?: string;
948
+ srcmatch?: RegExp;
949
+ srcmatchgroup?: RegExp;
950
+ to?: string;
951
+ applyafter?: string;
952
+ applybefore?: string;
953
+ expected?: number;
954
+ }
955
+ export declare class ModLoader {
956
+ readonly modSC2DataManager: SC2DataManager;
957
+ readonly modLoaderGui: Gui;
958
+ static getLodash(): ReturnType<ReturnType<SC2DataManager['getModUtils']>['getLodash']>;
959
+ readonly diagnostics: Diagnostics;
960
+ readonly resources: Resources;
961
+ constructor(modSC2DataManager: SC2DataManager, modLoaderGui: Gui);
962
+ replace(content: string, replacements: Replacement[], label?: string): string;
963
+ defineTwineAsset(type: 'script' | 'style', name: string, content: string | ((current: string) => string), mode?: TwineAssetMode): void;
964
+ disabled(modNames: string | string[], reload?: boolean): Promise<boolean>;
965
+ get modUtils(): ReturnType<SC2DataManager['getModUtils']>;
966
+ get modLoader(): ReturnType<SC2DataManager['getModLoader']>;
967
+ get loadController(): ReturnType<SC2DataManager['getModLoadController']>;
968
+ get dependence(): ReturnType<SC2DataManager['getDependenceChecker']>;
969
+ get conflict(): ReturnType<SC2DataManager['getConflictResult']>;
970
+ get lodash(): ReturnType<ReturnType<SC2DataManager['getModUtils']>['getLodash']>;
971
+ }
972
+ //#endregion
973
+ //#region src/host/SugarCube.d.ts
974
+ interface SaveObject {
975
+ state: {
976
+ history: DolStateMoment[];
977
+ index?: number;
978
+ [key: string]: unknown;
979
+ };
980
+ [key: string]: unknown;
981
+ }
982
+ export declare class Save {
983
+ private readonly state;
984
+ readonly details?: unknown;
985
+ readonly saveObj: SaveObject;
986
+ constructor(state: DolStateAPI, saveObj: unknown, details?: unknown);
987
+ get V(): Record<string, unknown>;
988
+ use<Result>(variables: Record<string, unknown>, callback: () => Result): Result;
989
+ }
990
+ export declare class SugarCube {
991
+ runtime: TwineSugarCube | undefined;
992
+ passage: Passage;
993
+ require(): TwineSugarCube;
994
+ save(saveObj: unknown, details?: unknown): Save;
995
+ }
996
+ //#endregion
997
+ //#region src/infra/Emitter.d.ts
998
+ type EventCallback<Args extends unknown[] = unknown[]> = (...args: Args) => unknown;
999
+ export declare class Emitter extends Diagnostics {
1000
+ private readonly events;
1001
+ private readonly afters;
1002
+ private readonly triggering;
1003
+ private readonly stickyEvents;
1004
+ private readonly stickyArgs;
1005
+ private readonly synchronousEvents;
1006
+ on<Args extends unknown[]>(eventName: string, callback: EventCallback<Args>, description?: string): boolean;
1007
+ off<Args extends unknown[]>(eventName: string, identifier: EventCallback<Args> | string): boolean;
1008
+ once<Args extends unknown[]>(eventName: string, callback: EventCallback<Args>, description?: string): boolean;
1009
+ trigger(eventName: string, ...args: unknown[]): Promise<void>;
1010
+ after<Args extends unknown[]>(eventName: string, callback: EventCallback<Args>): void;
1011
+ private pending;
1012
+ private callSticky;
1013
+ }
1014
+ //#endregion
925
1015
  //#region node_modules/idb/build/entry.d.ts
926
1016
  type KeyToKeyNoIndex<T> = { [K in keyof T]: string extends K ? never : number extends K ? never : K };
927
1017
  type ValuesOf<T> = T extends { [K in keyof T]: infer U } ? U : never;
@@ -1595,30 +1685,122 @@ interface IDBPCursorWithValueIteratorValue<
1595
1685
  continuePrimaryKey<T>(this: T, key: CursorKey<DBTypes, StoreName, IndexName>, primaryKey: StoreKey<DBTypes, StoreName>): void;
1596
1686
  }
1597
1687
  //#endregion
1598
- //#region src/services/IndexedDBService.d.ts
1688
+ //#region src/infra/Catalog.d.ts
1689
+ export declare class Catalog<Key, Value> extends Diagnostics {
1690
+ protected readonly items: Map<Key, Value>;
1691
+ constructor(modloader?: ModLoader, entries?: Iterable<readonly [Key, Value]>);
1692
+ add(key: Key, value: Value): boolean;
1693
+ remove(key: Key): boolean;
1694
+ get(key: Key): Value | undefined;
1695
+ has(key: Key): boolean;
1696
+ list(): Value[];
1697
+ clear(): void;
1698
+ get entries(): ReadonlyMap<Key, Value>;
1699
+ }
1700
+ //#endregion
1701
+ //#region src/services/IndexedDB.d.ts
1599
1702
  interface StoreIndex {
1600
1703
  name: string;
1601
1704
  keyPath: string | string[];
1602
1705
  options?: IDBIndexParameters;
1603
1706
  }
1707
+ interface StoreDefinition {
1708
+ options: IDBObjectStoreParameters;
1709
+ indexes: StoreIndex[];
1710
+ }
1604
1711
  type Transaction<Mode extends IDBTransactionMode = IDBTransactionMode> = IDBPTransaction<unknown, string[], Mode>;
1605
- declare class IndexedDBService {
1606
- readonly core: MaplebirchCore;
1712
+ export declare class IndexedDB extends Catalog<string, StoreDefinition> {
1607
1713
  static readonly DATABASE_NAME = 'maplebirch';
1608
1714
  static readonly DATABASE_VERSION: number;
1609
1715
  private db;
1610
1716
  private opening;
1611
- private readonly stores;
1612
- constructor(core: MaplebirchCore);
1613
- register(name: string, options?: IDBObjectStoreParameters, indexes?: StoreIndex[]): void;
1717
+ constructor(modloader?: ModLoader);
1718
+ define(name: string, options?: IDBObjectStoreParameters, indexes?: StoreIndex[]): boolean;
1719
+ loadLogLevel(): Promise<string | boolean | undefined>;
1614
1720
  init(): Promise<void>;
1615
1721
  private open;
1616
- withTransaction<T, Mode extends IDBTransactionMode>(storeNames: string | string[], mode: Mode, callback: (tx: Transaction<Mode>) => T | Promise<T>): Promise<T>;
1722
+ with<T, Mode extends IDBTransactionMode>(storeNames: string | string[], mode: Mode, callback: (tx: Transaction<Mode>) => T | Promise<T>): Promise<T>;
1617
1723
  clearStore(storeName: string): Promise<void>;
1618
1724
  deleteDatabase(): Promise<boolean>;
1619
1725
  }
1620
1726
  //#endregion
1621
- //#region src/services/CloudSaveService.d.ts
1727
+ //#region src/services/CredentialVault.d.ts
1728
+ type CredentialPeriod = 'day' | 'month';
1729
+ interface AuthConfig {
1730
+ key: string;
1731
+ subject?: string;
1732
+ name?: string;
1733
+ publicKey: JsonWebKey | string;
1734
+ prompt?: {
1735
+ title?: string;
1736
+ label?: string;
1737
+ placeholder?: string;
1738
+ hint?: string;
1739
+ };
1740
+ date?: {
1741
+ period?: CredentialPeriod;
1742
+ timezone?: string;
1743
+ graceDays?: number;
1744
+ };
1745
+ }
1746
+ interface AuthPayload {
1747
+ subject: string;
1748
+ key: string;
1749
+ date?: string;
1750
+ password: string;
1751
+ expiresAt?: number;
1752
+ }
1753
+ interface CryptContext {
1754
+ modName: string;
1755
+ credential?: string;
1756
+ payload?: AuthPayload;
1757
+ }
1758
+ interface CryptResult {
1759
+ data: Awaited<InputFileFormat>;
1760
+ auth?: AuthConfig | boolean | void;
1761
+ }
1762
+ interface CryptOptions {
1763
+ modName?: string;
1764
+ cache?: {
1765
+ subject: string;
1766
+ key: string;
1767
+ };
1768
+ password?: string;
1769
+ prompt?: AuthConfig['prompt'] & {
1770
+ name?: string;
1771
+ };
1772
+ lazyOptions?: unknown;
1773
+ decrypt(password: string, context: CryptContext): Promise<CryptResult | Awaited<InputFileFormat>>;
1774
+ }
1775
+ export declare class CredentialVault {
1776
+ readonly idb: IndexedDB;
1777
+ readonly modloader: ModLoader;
1778
+ readonly events: Emitter;
1779
+ readonly diagnostics: Diagnostics;
1780
+ readonly translate: (key: string) => string;
1781
+ private static readonly STORE;
1782
+ private static readonly TOKEN_PREFIX;
1783
+ private dialogQueue;
1784
+ private storageKey;
1785
+ constructor(idb: IndexedDB, modloader: ModLoader, events: Emitter, diagnostics: Diagnostics, translate: (key: string) => string);
1786
+ loadCrypt(options: CryptOptions): Promise<boolean>;
1787
+ private loadCredential;
1788
+ private decryptAndLoad;
1789
+ private decodeCredential;
1790
+ private verify;
1791
+ private credentialDate;
1792
+ private readStored;
1793
+ private storeStored;
1794
+ private forget;
1795
+ private ensurePromptStyle;
1796
+ private promptCredential;
1797
+ private ensureStorageKey;
1798
+ private loadStorageKey;
1799
+ private encryptRecord;
1800
+ private decryptRecord;
1801
+ }
1802
+ //#endregion
1803
+ //#region src/services/CloudSave.d.ts
1622
1804
  type CloudSaveSlot = number;
1623
1805
  type PanelAction = 'connectRemote' | 'uploadSlot' | 'downloadSlot' | 'refreshRemoteList' | 'deleteRemoteSlot' | 'exportCurrentCode' | 'exportSlotCode' | 'uploadCode' | 'downloadCode' | 'importCode';
1624
1806
  interface CloudSaveConfig {
@@ -1662,14 +1844,23 @@ interface SaveState {
1662
1844
  delta?: unknown;
1663
1845
  [key: string]: unknown;
1664
1846
  }
1665
- declare class CloudSaveService {
1666
- readonly core: MaplebirchCore;
1847
+ interface CloudSaveTools {
1848
+ isPlainObject(value: unknown): value is Record<string, unknown>;
1849
+ isFinite(value: unknown): boolean;
1850
+ isInteger(value: unknown): boolean;
1851
+ inRange(value: number, start: number, end: number): boolean;
1852
+ }
1853
+ export declare class CloudSave {
1854
+ readonly sugarcube: SugarCube;
1855
+ readonly translate: (key: string) => string;
1856
+ readonly tools: CloudSaveTools;
1857
+ readonly diagnostics: Diagnostics;
1667
1858
  private static readonly PANEL_STORAGE_KEY;
1668
1859
  private static readonly REQUEST_TIMEOUT;
1669
1860
  private config;
1670
1861
  private mountFrame;
1671
1862
  private busy;
1672
- constructor(core: MaplebirchCore);
1863
+ constructor(sugarcube: SugarCube, translate: (key: string) => string, tools: CloudSaveTools, diagnostics: Diagnostics);
1673
1864
  configure(config: CloudSaveConfig): this;
1674
1865
  /** 验证 Worker 与 Token 是否可用。 */
1675
1866
  connect(): Promise<void>;
@@ -1730,7 +1921,18 @@ declare class CloudSaveService {
1730
1921
  private get token();
1731
1922
  }
1732
1923
  //#endregion
1733
- //#region src/services/LanguageManager.d.ts
1924
+ //#region src/constants.d.ts
1925
+ type LanguageCode = (typeof Languages)[number];
1926
+ declare const Languages: readonly ['EN', 'CN'];
1927
+ declare enum ModuleState {
1928
+ REGISTERED = 0,
1929
+ MOUNTED = 1,
1930
+ ERROR = 2,
1931
+ EXPOSED = 3,
1932
+ DISABLED = 4
1933
+ }
1934
+ //#endregion
1935
+ //#region src/services/Translator.d.ts
1734
1936
  type Translation = Record<string, string>;
1735
1937
  interface ImportProgress {
1736
1938
  type: 'process' | 'complete' | 'error' | 'not_found';
@@ -1741,21 +1943,25 @@ interface ImportProgress {
1741
1943
  count?: number;
1742
1944
  error?: Error | null;
1743
1945
  }
1744
- declare class LanguageManager {
1745
- readonly core: MaplebirchCore;
1946
+ interface TranslationAddon {
1947
+ hook<T>(name: string, handler: (task: { modName: string; config: T }) => void | Promise<void>): boolean;
1948
+ }
1949
+ export declare class Translator extends Catalog<string, Translation> {
1950
+ readonly idb: IndexedDB;
1951
+ readonly events: Emitter;
1952
+ private readonly addon;
1746
1953
  static readonly DEFAULT_LANGS: readonly LanguageCode[];
1747
1954
  static readonly BATCH_SIZE = 500;
1748
1955
  language: LanguageCode;
1749
1956
  private readonly STORE;
1750
- private readonly translations;
1751
1957
  private readonly cache;
1752
1958
  private readonly sourceOrders;
1753
1959
  private preloaded;
1754
- constructor(core: MaplebirchCore);
1960
+ constructor(idb: IndexedDB, modloader: ModLoader, events: Emitter, addon: () => TranslationAddon | undefined);
1755
1961
  private initDB;
1756
1962
  setLanguage(language?: string): Promise<LanguageCode>;
1757
1963
  import(modName: string, languages?: readonly LanguageCode[]): AsyncGenerator<ImportProgress>;
1758
- importFile(modName: string, language: LanguageCode, path: string): AsyncGenerator<ImportProgress>;
1964
+ importFile(modName: string, language: LanguageCode, paths: string | readonly string[]): AsyncGenerator<ImportProgress>;
1759
1965
  t(translationKey: string, space?: boolean): string;
1760
1966
  auto(text: string): string;
1761
1967
  has(translationKey: string): boolean;
@@ -1779,10 +1985,35 @@ declare class LanguageManager {
1779
1985
  private rebuild;
1780
1986
  }
1781
1987
  //#endregion
1782
- //#region src/services/ModuleSystem.d.ts
1988
+ //#region src/infra/Lifecycle.d.ts
1989
+ type LifecyclePhase = 'preInit' | 'Init' | 'loadInit' | 'postInit';
1990
+ interface LifecycleTarget {
1991
+ preInit?(): void | Promise<void>;
1992
+ Init?(): void;
1993
+ loadInit?(): void;
1994
+ postInit?(): void;
1995
+ }
1996
+ interface LifecycleResult {
1997
+ called: boolean;
1998
+ ok: boolean;
1999
+ error?: unknown;
2000
+ }
2001
+ export declare class Lifecycle<Key = string, Target extends LifecycleTarget = LifecycleTarget> extends Catalog<Key, Target> {
2002
+ preInit(): void | Promise<void>;
2003
+ Init(): void;
2004
+ loadInit(): void;
2005
+ postInit(): void;
2006
+ execute(target: Target, phase: 'preInit', scope?: string): Promise<LifecycleResult>;
2007
+ execute(target: Target, phase: Exclude<LifecyclePhase, 'preInit'>, scope?: string): LifecycleResult;
2008
+ execute(target: Target, phase: LifecyclePhase, scope?: string): LifecycleResult | Promise<LifecycleResult>;
2009
+ private failure;
2010
+ }
2011
+ //#endregion
2012
+ //#region src/services/Modules.d.ts
1783
2013
  interface Module {
2014
+ log?: ScopedLog;
1784
2015
  dependencies?: string[];
1785
- exposed?: boolean;
2016
+ exposed?: boolean | 'window';
1786
2017
  preInit?(): void | Promise<void>;
1787
2018
  Init?(): void;
1788
2019
  loadInit?(): void;
@@ -1798,7 +2029,6 @@ interface ModuleRegistry {
1798
2029
  interface DependencyInfo {
1799
2030
  protected: boolean;
1800
2031
  mounted: boolean;
1801
- early: boolean;
1802
2032
  exposed: boolean;
1803
2033
  lifecycle: boolean;
1804
2034
  dependencies: string[];
@@ -1808,8 +2038,14 @@ interface DependencyInfo {
1808
2038
  source: string;
1809
2039
  }
1810
2040
  type DependencyGraph = Record<string, DependencyInfo>;
1811
- declare class ModuleSystem {
1812
- readonly core: MaplebirchCore;
2041
+ interface ModulesMeta {
2042
+ core: readonly string[];
2043
+ protected: readonly string[];
2044
+ }
2045
+ export declare class Modules extends Lifecycle<string, Module> {
2046
+ readonly owner: Record<string, unknown>;
2047
+ readonly meta: ModulesMeta;
2048
+ readonly idb: IndexedDB;
1813
2049
  readonly registry: ModuleRegistry;
1814
2050
  readonly initPhase: {
1815
2051
  preInitCompleted: boolean;
@@ -1822,7 +2058,7 @@ declare class ModuleSystem {
1822
2058
  private late;
1823
2059
  private preRunning;
1824
2060
  private preQueued;
1825
- constructor(core: MaplebirchCore);
2061
+ constructor(owner: Record<string, unknown>, meta: ModulesMeta, idb: IndexedDB, modloader?: ModLoader);
1826
2062
  static traverse(roots: Iterable<string>, links: ReadonlyMap<string, Iterable<string>>, excluded?: ReadonlySet<string>): Set<string>;
1827
2063
  with<T>(source: string, callback: () => T | Promise<T>): Promise<T>;
1828
2064
  register<T extends object>(name: string, module: T & Module, dependencies?: string[]): boolean;
@@ -1830,20 +2066,18 @@ declare class ModuleSystem {
1830
2066
  get dependencyGraph(): DependencyGraph;
1831
2067
  run(phase: 'pre'): Promise<void>;
1832
2068
  run(phase: 'init' | 'load' | 'post'): void;
1833
- private preInit;
2069
+ private prepare;
1834
2070
  private queuePre;
1835
2071
  private disable;
1836
2072
  private pre;
1837
2073
  private init;
1838
2074
  private phase;
1839
- private callHook;
1840
2075
  private ready;
1841
- private flushEarly;
2076
+ private flush;
1842
2077
  private topologicalOrder;
1843
2078
  private collect;
1844
2079
  private circular;
1845
- private lifecycle;
1846
- private promiseLike;
2080
+ private hasLifecycle;
1847
2081
  }
1848
2082
  //#endregion
1849
2083
  //#region src/services/GUIControl.d.ts
@@ -1860,14 +2094,25 @@ interface ModulesSettings {
1860
2094
  enabled: ModuleInfo[];
1861
2095
  disabled: ModuleInfo[];
1862
2096
  }
1863
- declare class GUIControl {
1864
- readonly core: MaplebirchCore;
2097
+ interface ScriptSource {
2098
+ jsFiles: Array<{
2099
+ modName: string;
2100
+ filePath: string;
2101
+ }>;
2102
+ }
2103
+ export declare class GUIControl {
2104
+ readonly idb: IndexedDB;
2105
+ readonly modloader: ModLoader;
2106
+ readonly events: Emitter;
2107
+ readonly modules: Modules;
2108
+ readonly translator: Translator;
2109
+ private readonly addon;
1865
2110
  enabledModules: ModuleInfo[];
1866
2111
  disabledModules: ModuleInfo[];
1867
2112
  enabledScripts: string[];
1868
2113
  disabledScripts: string[];
1869
2114
  private modSubUiAngularJsService;
1870
- constructor(core: MaplebirchCore);
2115
+ constructor(idb: IndexedDB, modloader: ModLoader, events: Emitter, modules: Modules, translator: Translator, addon: () => ScriptSource | undefined);
1871
2116
  private initSettings;
1872
2117
  init(): Promise<void>;
1873
2118
  private loadSettings;
@@ -1877,6 +2122,7 @@ declare class GUIControl {
1877
2122
  private modulesStore;
1878
2123
  private scriptsStore;
1879
2124
  saveModules(enabled: ModuleInfo[], disabled: ModuleInfo[]): Promise<void>;
2125
+ setModuleStates(states: Readonly<Record<string, boolean>>): Promise<boolean>;
1880
2126
  saveScripts(enabled: string[], disabled: string[]): Promise<void>;
1881
2127
  cascadeModules(action: 'enable' | 'disable', moduleName: string, modules: ModulesSettings): string[];
1882
2128
  private moduleLinks;
@@ -1884,169 +2130,248 @@ declare class GUIControl {
1884
2130
  private whenCreate;
1885
2131
  }
1886
2132
  //#endregion
1887
- //#region src/modules/Addon/Save.d.ts
1888
- interface SaveObject {
1889
- state: {
1890
- history: DolStateMoment[];
1891
- index?: number;
1892
- [key: string]: unknown;
1893
- };
1894
- [key: string]: unknown;
1895
- }
1896
- declare class Save {
1897
- private readonly state;
1898
- readonly details?: unknown;
1899
- readonly saveObj: SaveObject;
1900
- constructor(state: DolStateAPI, saveObj: unknown, details?: unknown);
1901
- get V(): Record<string, unknown>;
1902
- use<T>(variables: Record<string, unknown>, callback: () => T): T;
2133
+ //#region src/infra/Hooks.d.ts
2134
+ type HookCallback<Args extends unknown[] = unknown[], Result = unknown> = (...args: Args) => Result | Promise<Result>;
2135
+ type HookErrorPolicy = 'throw' | 'continue';
2136
+ export declare class Hooks<Args extends unknown[] = unknown[], Result = unknown> extends Catalog<string, HookCallback<Args, Result>> {
2137
+ private readonly onError;
2138
+ private readonly order;
2139
+ constructor(modloader?: ModLoader, onError?: HookErrorPolicy);
2140
+ add(name: string, callback: HookCallback<Args, Result>, order?: number): boolean;
2141
+ remove(name: string): boolean;
2142
+ clear(): void;
2143
+ execute(...args: Args): Result[];
2144
+ call(name: string, ...args: Args): Promise<Awaited<Result> | undefined>;
1903
2145
  }
1904
2146
  //#endregion
1905
- //#region src/modules/TimeStateWeather/Event.d.ts
1906
- interface EventOptions {
1907
- priority?: number;
1908
- once?: boolean;
1909
- }
1910
- declare abstract class Event {
1911
- readonly id: string;
1912
- readonly priority: number;
1913
- readonly once: boolean;
1914
- protected abstract readonly eventName: string;
1915
- protected constructor(id: string, options?: EventOptions);
1916
- protected evaluate<T extends unknown[]>(label: string, callback: (...args: T) => boolean, ...args: T): boolean;
1917
- protected invoke<T extends unknown[]>(label: string, callback: ((...args: T) => void) | undefined, ...args: T): void;
2147
+ //#region src/services/AddonPlugin.d.ts
2148
+ interface FileItem {
2149
+ modName: string;
2150
+ filePath: string;
2151
+ content: string;
1918
2152
  }
1919
- //#endregion
1920
- //#region src/modules/TimeStateWeather/TimeEvents.d.ts
1921
- type TimeEventType = 'onSec' | 'onMin' | 'onHour' | 'onDay' | 'onWeek' | 'onMonth' | 'onYear' | 'onBefore' | 'onThread' | 'onAfter' | 'onTimeTravel';
1922
- type TimeUnit = 'sec' | 'min' | 'hour' | 'day' | 'week' | 'month' | 'year';
1923
- interface AccumulateConfig {
1924
- unit: TimeUnit;
1925
- target?: number;
2153
+ interface BootTask<T = unknown> {
2154
+ modName: string;
2155
+ modInfo: ModInfo;
2156
+ modZip: ModZipReader;
2157
+ config: T;
1926
2158
  }
1927
- interface TimeData {
1928
- prevDate?: DateTime;
1929
- currentDate?: DateTime;
1930
- changes?: Record<TimeUnit, number>;
1931
- triggeredByAccumulator?: {
1932
- unit: TimeUnit;
1933
- target: number;
1934
- count: number;
1935
- };
1936
- exactPoints?: {
1937
- min: boolean;
1938
- hour: boolean;
1939
- day: boolean;
1940
- week: boolean;
1941
- month: boolean;
1942
- year: boolean;
1943
- };
1944
- passed?: number;
1945
- sec?: number;
1946
- min?: number;
1947
- hour?: number;
1948
- day?: number;
1949
- week?: number;
1950
- month?: number;
1951
- year?: number;
1952
- weekday?: [number, number];
1953
- detailedDiff?: ReturnType<DateTime['compareWith']>;
1954
- timeStamp?: number;
1955
- prev?: DateTime;
1956
- current?: DateTime;
1957
- diffSeconds?: number;
1958
- direction?: 'forward' | 'backward';
1959
- isLeap?: boolean;
2159
+ type BootHandler<T = unknown> = (task: BootTask<T>) => void | Promise<void>;
2160
+ interface AddonServices {
2161
+ translator(): Translator;
2162
+ gui(): GUIControl;
2163
+ credential(): CredentialVault;
2164
+ }
2165
+ export declare class AddonPlugin extends Hooks<[BootTask], void> {
2166
+ readonly sugarcube: SugarCube;
2167
+ readonly events: Emitter;
2168
+ readonly idb: IndexedDB;
2169
+ readonly modules: Modules;
2170
+ private readonly services;
2171
+ onStart: boolean;
2172
+ get resources(): Resources;
2173
+ replace(content: string, replacements: Replacement[], label?: string): string;
2174
+ readonly info: Catalog<
2175
+ string,
2176
+ {
2177
+ addonName: string;
2178
+ mod: ModInfo;
2179
+ modZip: ModZipReader;
2180
+ }
2181
+ >;
2182
+ readonly modList: string[];
2183
+ readonly jsFiles: FileItem[];
2184
+ readonly moduleFiles: FileItem[];
2185
+ private readonly disabledMods;
2186
+ readonly blockedPassages: Set<string>;
2187
+ readonly excludedMods: Set<string>;
2188
+ private readonly bootQueue;
2189
+ private onSaveLoadTracer;
2190
+ private moduleFilesExecuted;
2191
+ private scriptFilesExecuted;
2192
+ private bootReady;
2193
+ constructor(modloader: ModLoader, sugarcube: SugarCube, events: Emitter, idb: IndexedDB, modules: Modules, services: AddonServices);
2194
+ get SC2DataManager(): SC2DataManager;
2195
+ get modUtils(): ModUtils;
2196
+ wikify(name: string, callbacks: WikifyTracerCallback): void;
2197
+ hook<T>(name: string, handler: BootHandler<T>): boolean;
2198
+ canLoadThisMod(bootJson: ModBootJson, _zip: JSZipLikeReadOnlyInterface): Promise<boolean>;
2199
+ afterInjectEarlyLoad(): Promise<void>;
2200
+ ModLoaderLoadEnd(): Promise<void>;
2201
+ afterEarlyLoad(): Promise<void>;
2202
+ registerMod(addonName: string, modInfo: ModInfo, modZip: ModZipReader): Promise<void>;
2203
+ afterRegisterMod2Addon(): Promise<void>;
2204
+ beforePatchModToGame(): Promise<void>;
2205
+ PatchModToGame_start(): Promise<void>;
2206
+ afterPatchModToGame(): Promise<void>;
2207
+ afterPreload(): Promise<void>;
2208
+ whenSC2StoryReady(): Promise<void>;
2209
+ whenSC2PassageInit(passage: Passage): Promise<void>;
2210
+ whenSC2PassageStart(passage: Passage, content: HTMLDivElement): Promise<void>;
2211
+ whenSC2PassageRender(passage: Passage, content: HTMLDivElement): Promise<void>;
2212
+ whenSC2PassageDisplay(passage: Passage, content: HTMLDivElement): Promise<void>;
2213
+ whenSC2PassageEnd(passage: Passage, content: HTMLDivElement): Promise<void>;
2214
+ loadCrypt(options: CryptOptions): Promise<boolean>;
2215
+ private scriptFiles;
2216
+ private loadFiles;
2217
+ private executeScripts;
2218
+ private process;
2219
+ private queue;
2220
+ private flush;
2221
+ private run;
2222
+ private config;
1960
2223
  }
1961
- interface TimeEventOptions extends EventOptions {
1962
- action?: (data: TimeData) => void;
1963
- cond?: (data: TimeData) => boolean;
1964
- accumulate?: AccumulateConfig;
1965
- exact?: boolean;
2224
+ //#endregion
2225
+ //#region src/core.d.ts
2226
+ declare global {
2227
+ interface MaplebirchExtensions {}
1966
2228
  }
1967
- interface TimeTravelOptions {
1968
- target?: DateTime;
1969
- year?: number;
1970
- month?: number;
1971
- day?: number;
1972
- hour?: number;
1973
- minute?: number;
1974
- second?: number;
1975
- addYears?: number;
1976
- addMonths?: number;
1977
- addDays?: number;
1978
- addHours?: number;
1979
- addMinutes?: number;
1980
- addSeconds?: number;
2229
+ interface Extensions extends MaplebirchExtensions {}
2230
+ interface CoreEvents {
2231
+ ':indexedDB': [];
2232
+ ':idbReady': [];
2233
+ ':import': [];
2234
+ ':variable': [];
2235
+ ':onSave': [save: Save];
2236
+ ':onLoad': [save: Save];
2237
+ ':language': [];
2238
+ ':storyready': [];
2239
+ ':passageinit': [passage: Passage];
2240
+ ':passagestart': [passage: Passage, content: HTMLDivElement];
2241
+ ':passagerender': [passage: Passage, content: HTMLDivElement];
2242
+ ':passagedisplay': [passage: Passage, content: HTMLDivElement];
2243
+ ':passageend': [passage: Passage, content: HTMLDivElement];
2244
+ ':sugarcube': [];
2245
+ ':modLoaderEnd': [];
1981
2246
  }
1982
- declare class TimeEvent extends Event {
1983
- readonly type: TimeEventType;
1984
- protected readonly eventName = 'TimeEvent';
1985
- private action?;
1986
- private cond;
1987
- private exact;
1988
- private accumulate?;
1989
- private accumulated;
1990
- private target;
1991
- constructor(id: string, type: TimeEventType, options?: TimeEventOptions);
1992
- tryRun(data: TimeData, accumulatedOnly?: boolean): boolean;
1993
- private runAccumulated;
1994
- private execute;
1995
- private match;
1996
- private runAction;
1997
- private isExactPoint;
2247
+ interface FrameworkHost {
2248
+ readonly sugarcube: SugarCube;
2249
+ readonly modLoader: ModLoader;
1998
2250
  }
1999
- declare class TimeManager {
2000
- private readonly manager;
2001
- private readonly eventTypes;
2002
- private readonly timeEvents;
2003
- private readonly sortedEventsCache;
2004
- readonly log: DynamicManager['log'];
2005
- readonly TimeConstants: Readonly<{
2006
- secondsPerDay: 86400;
2007
- secondsPerHour: 3600;
2008
- secondsPerMinute: 60;
2009
- minutesPerHour: 60;
2010
- standardYearMonths: readonly number[];
2011
- leapYearMonths: readonly number[];
2012
- synodicMonth: 29.53058867;
2013
- MIN_DATE: Readonly<{
2014
- timeStamp: -315537984000;
2015
- year: -9999;
2016
- month: 1;
2017
- day: 1;
2018
- hour: 0;
2019
- minute: 0;
2020
- second: 0;
2251
+ interface FrameworkInfra {
2252
+ readonly diagnostics: Diagnostics;
2253
+ readonly events: Emitter;
2254
+ }
2255
+ interface FrameworkServices {
2256
+ readonly indexedDB: IndexedDB;
2257
+ readonly modules: Modules;
2258
+ readonly addonPlugin: AddonPlugin;
2259
+ readonly translator: Translator;
2260
+ readonly credentialVault: CredentialVault;
2261
+ readonly cloudSave: CloudSave;
2262
+ readonly gui: GUIControl;
2263
+ }
2264
+ type MaplebirchCore = InstanceType<typeof MaplebirchCore> & Extensions;
2265
+ declare const MaplebirchCore: {
2266
+ new (
2267
+ modSC2DataManager: SC2DataManager,
2268
+ modLoaderGui: Gui
2269
+ ): {
2270
+ readonly meta: {
2271
+ name: 'maplebirch Frameworks';
2272
+ author: string;
2273
+ version: string;
2274
+ modifiedby: string;
2275
+ updateDate: string;
2276
+ Languages: readonly ['EN', 'CN'];
2277
+ core: readonly string[];
2278
+ protected: readonly string[];
2279
+ };
2280
+ readonly host: Readonly<FrameworkHost>;
2281
+ readonly infra: Readonly<FrameworkInfra>;
2282
+ readonly services: Readonly<FrameworkServices>;
2283
+ readonly utils: Readonly<{
2284
+ clone: typeof clone;
2285
+ equal: typeof equal;
2286
+ merge: typeof merge;
2287
+ append: typeof append;
2288
+ cover: typeof cover;
2289
+ mergefn: typeof mergeFn;
2290
+ appendfn: typeof appendFn;
2291
+ coverfn: typeof coverFn;
2292
+ contains: typeof contains;
2293
+ random: typeof randomNumber;
2294
+ either: typeof randomPick;
2295
+ SelectCase: typeof SelectCase;
2296
+ convert: typeof convert;
2297
+ clamp: typeof clamp;
2021
2298
  }>;
2022
- MAX_DATE: Readonly<{
2023
- timeStamp: 315537897599;
2024
- year: 9999;
2025
- month: 12;
2026
- day: 31;
2027
- hour: 23;
2028
- minute: 59;
2029
- second: 59;
2299
+ readonly yaml: Readonly<typeof jsyaml>;
2300
+ readonly howler: Readonly<{
2301
+ Howl: typeof Howl;
2302
+ Howler: HowlerGlobal;
2030
2303
  }>;
2031
- }>;
2032
- constructor(manager: DynamicManager);
2033
- get events(): Readonly<Record<string, ReadonlyMap<string, TimeEvent>>>;
2034
- init(): void;
2035
- patchDateTime(DateTimeClass: typeof DateTime): typeof DateTime;
2036
- patchTime(TimeObject: typeof Time): void;
2037
- register(type: TimeEventType, eventId: string, options: TimeEventOptions): boolean;
2038
- unregister(type: string, eventId: string): boolean;
2039
- timeTravel(options?: TimeTravelOptions): boolean;
2040
- updateTimeLanguage(choice?: 'JournalTime'): string | boolean;
2041
- private handleTimePass;
2042
- private handleTimeTravel;
2043
- private targetDate;
2044
- private timeData;
2045
- private triggerUnitEvents;
2046
- private trigger;
2304
+ log(message: string, level?: string, ...objects: unknown[]): void;
2305
+ get export(): string;
2306
+ get passage(): Passage;
2307
+ set passage(passage: Passage);
2308
+ get SugarCube(): TwineSugarCube;
2309
+ set SugarCube(runtime: TwineSugarCube);
2310
+ get modUtils(): ReturnType<SC2DataManager['getModUtils']>;
2311
+ get modLoader(): ReturnType<SC2DataManager['getModLoader']>;
2312
+ get lodash(): ModLoader['lodash'];
2313
+ get marked(): typeof marked;
2314
+ get Language(): string;
2315
+ set Language(language: string);
2316
+ get LogLevel(): string;
2317
+ set LogLevel(level: string);
2318
+ get dependencyGraph(): DependencyGraph;
2319
+ on<Name extends keyof CoreEvents>(eventName: Name, callback: EventCallback<CoreEvents[Name]>, description?: string): boolean;
2320
+ on<Name extends string, Args extends unknown[]>(eventName: Name extends keyof CoreEvents ? never : Name, callback: EventCallback<Args>, description?: string): boolean;
2321
+ off<Args extends unknown[]>(eventName: string, identifier: string | EventCallback<Args>): boolean;
2322
+ once<Name extends keyof CoreEvents>(eventName: Name, callback: EventCallback<CoreEvents[Name]>, description?: string): boolean;
2323
+ once<Name extends string, Args extends unknown[]>(eventName: Name extends keyof CoreEvents ? never : Name, callback: EventCallback<Args>, description?: string): boolean;
2324
+ after<Name extends keyof CoreEvents>(eventName: Name, callback: EventCallback<CoreEvents[Name]>): void;
2325
+ after<Name extends string, Args extends unknown[]>(eventName: Name extends keyof CoreEvents ? never : Name, callback: EventCallback<Args>): void;
2326
+ trigger<Name extends keyof CoreEvents>(eventName: Name, ...args: CoreEvents[Name]): Promise<void>;
2327
+ trigger<Name extends string>(eventName: Name extends keyof CoreEvents ? never : Name, ...args: unknown[]): Promise<void>;
2328
+ define<T extends object>(name: string, module: T & Module, dependencies?: string[]): boolean;
2329
+ wikify(name: string, callbacks: WikifyTracerCallback): void;
2330
+ idb(name: string, options?: IDBObjectStoreParameters, indexes?: StoreIndex[]): boolean;
2331
+ with<T, Mode extends IDBTransactionMode>(storeNames: string | string[], mode: Mode, callback: (tx: Transaction<Mode>) => T | Promise<T>): Promise<T>;
2332
+ t(key: string, space?: boolean): string;
2333
+ auto(text: string): string;
2334
+ get<K extends keyof Extensions>(name: K): Extensions[K] | undefined;
2335
+ get(name: string): Module | undefined;
2336
+ };
2337
+ meta: {
2338
+ name: 'maplebirch Frameworks';
2339
+ author: string;
2340
+ version: string;
2341
+ modifiedby: string;
2342
+ updateDate: string;
2343
+ Languages: readonly ['EN', 'CN'];
2344
+ core: readonly string[];
2345
+ protected: readonly string[];
2346
+ };
2347
+ };
2348
+ declare var maplebirch: MaplebirchCore;
2349
+ //#endregion
2350
+ //#region src/modules/Dynamic.d.ts
2351
+ declare class Dynamic extends Lifecycle<string, LifecycleTarget> {
2352
+ readonly core: MaplebirchCore;
2353
+ readonly log: ScopedLog;
2354
+ constructor(core: MaplebirchCore);
2355
+ Init(): void;
2047
2356
  }
2048
2357
  //#endregion
2049
- //#region src/modules/TimeStateWeather/StateEvents.d.ts
2358
+ //#region src/modules/Event.d.ts
2359
+ interface EventOptions {
2360
+ priority?: number;
2361
+ once?: boolean;
2362
+ }
2363
+ declare abstract class Event {
2364
+ readonly id: string;
2365
+ protected readonly log: ScopedLog;
2366
+ readonly priority: number;
2367
+ readonly once: boolean;
2368
+ protected abstract readonly eventName: string;
2369
+ protected constructor(id: string, options: EventOptions, log: ScopedLog);
2370
+ protected evaluate<T extends unknown[]>(label: string, callback: (...args: T) => boolean, ...args: T): boolean;
2371
+ protected invoke<T extends unknown[]>(label: string, callback: ((...args: T) => void) | undefined, ...args: T): void;
2372
+ }
2373
+ //#endregion
2374
+ //#region src/modules/State.d.ts
2050
2375
  interface StateEventOptions extends EventOptions {
2051
2376
  output?: string;
2052
2377
  action?: () => void;
@@ -2070,121 +2395,27 @@ declare class StateEvent extends Event {
2070
2395
  private cond;
2071
2396
  private forceExit;
2072
2397
  private extra;
2073
- constructor(id: string, type: 'gate' | 'append', options?: StateEventOptions);
2398
+ constructor(id: string, type: 'gate' | 'append', options: StateEventOptions, log: Dynamic['log']);
2074
2399
  private checkPassage;
2075
2400
  tryRun(passageName?: string): StateEventResult | null;
2076
2401
  private match;
2077
2402
  private runAction;
2078
2403
  shouldForceExit(): boolean;
2079
2404
  }
2080
- declare class StateManager {
2405
+ export declare class StateManager {
2081
2406
  private readonly manager;
2082
2407
  private readonly stateEvents;
2083
2408
  private readonly log;
2084
- constructor(manager: DynamicManager);
2409
+ constructor(manager: Dynamic);
2085
2410
  get events(): Readonly<Record<'gate' | 'append', ReadonlyMap<string, StateEvent>>>;
2086
2411
  trigger(type: 'gate' | 'append'): string;
2087
2412
  private processGateEvents;
2088
2413
  private processAppendEvents;
2089
2414
  register(type: 'gate' | 'append', eventId: string, options: StateEventOptions): boolean;
2090
2415
  unregister(type: 'gate' | 'append', eventId: string): boolean;
2091
- init(): void;
2092
- }
2093
- //#endregion
2094
- //#region src/modules/TimeStateWeather/WeatherEvents.d.ts
2095
- interface WeatherEventOptions extends EventOptions {
2096
- condition?: () => boolean;
2097
- onEnter?: () => void;
2098
- onExit?: () => void;
2099
- [key: string]: any;
2100
- }
2101
- interface WeatherTypeConfig {
2102
- name: string;
2103
- iconType?: string | (() => string);
2104
- value: number;
2105
- probability: {
2106
- summer: number;
2107
- winter: number;
2108
- spring: number;
2109
- autumn: number;
2110
- };
2111
- cloudCount: {
2112
- small: () => number;
2113
- large: () => number;
2114
- };
2115
- tanningModifier: number;
2116
- overcast: number | (() => number);
2117
- precipitationIntensity: number;
2118
- visibility: number;
2119
- }
2120
- interface WeatherException {
2121
- date: () => DateTime;
2122
- duration: number;
2123
- weatherType: string;
2124
- temperature?: number;
2125
- }
2126
- declare class WeatherManager {
2127
- private readonly manager;
2128
- private readonly weatherEvents;
2129
- private readonly activeEvents;
2130
- private sortedEventsCache;
2131
- private readonly Exceptions;
2132
- private readonly WeatherTypes;
2133
- private readonly layerModifications;
2134
- private readonly effectModifications;
2135
- private weatherTriggered;
2136
- private readonly log;
2137
- constructor(manager: DynamicManager);
2138
- private checkEvents;
2139
- register(eventId: string, options: WeatherEventOptions): boolean;
2140
- unregister(eventId: string): boolean;
2141
- addLayer(layerName: string, patch: any, mode?: 'concat' | 'replace' | 'merge'): this;
2142
- addEffect(effectName: string, patch: any, mode?: 'concat' | 'replace' | 'merge'): this;
2143
- applyModifications(params: any): any;
2144
- addWeatherData(data: WeatherException | WeatherTypeConfig): boolean | void;
2145
- init(): void;
2146
- modifyWeatherJavaScript(manager: AddonPlugin): void;
2147
- }
2148
- //#endregion
2149
- //#region src/modules/Dynamic.d.ts
2150
- declare class DynamicManager {
2151
- readonly core: MaplebirchCore;
2152
- readonly Time: TimeManager;
2153
- readonly State: StateManager;
2154
- readonly Weather: WeatherManager;
2155
- readonly log: ReturnType<typeof createlog>;
2156
- constructor(core: MaplebirchCore);
2157
- regTimeEvent(type: TimeEventType, eventId: string, options: TimeEventOptions): boolean;
2158
- delTimeEvent(type: TimeEventType, eventId: string): boolean;
2159
- timeTravel(options?: TimeTravelOptions): boolean;
2160
- get TimeEvents(): TimeManager['events'];
2161
- regStateEvent(type: 'gate' | 'append', eventId: string, options: StateEventOptions): boolean;
2162
- delStateEvent(type: 'gate' | 'append', eventId: string): boolean;
2163
- trigger(type: 'gate' | 'append'): string;
2164
- get StateEvents(): StateManager['events'];
2165
- regWeatherEvent(eventId: string, options: WeatherEventOptions): boolean;
2166
- delWeatherEvent(eventId: string): boolean;
2167
- addWeather(data: WeatherException | WeatherTypeConfig): boolean | void;
2168
2416
  Init(): void;
2169
2417
  }
2170
2418
  //#endregion
2171
- //#region src/modules/Frameworks/TimeTravelCheat.d.ts
2172
- declare class TimeTravelCheat {
2173
- private readonly core;
2174
- private readonly ids;
2175
- constructor(core: MaplebirchCore);
2176
- fragment(): DocumentFragment;
2177
- private createRoot;
2178
- private bind;
2179
- private render;
2180
- private fieldInput;
2181
- private setFields;
2182
- private readFields;
2183
- private syncDayLimit;
2184
- private travel;
2185
- private status;
2186
- }
2187
- //#endregion
2188
2419
  //#region src/modules/Frameworks/ConsoleCheat.d.ts
2189
2420
  interface JSExecutionResult {
2190
2421
  success: boolean;
@@ -2214,7 +2445,6 @@ declare class CheatConsole {
2214
2445
  private readonly log;
2215
2446
  private readonly core;
2216
2447
  private readonly globals;
2217
- readonly timeTravel: TimeTravelCheat;
2218
2448
  private readonly jsStatus;
2219
2449
  private readonly twineStatus;
2220
2450
  private readonly twineOutputs;
@@ -2240,7 +2470,7 @@ interface PathRef {
2240
2470
  key: string;
2241
2471
  }
2242
2472
  interface Utils {
2243
- readonly log: ReturnType<typeof createlog>;
2473
+ readonly log: ScopedLog;
2244
2474
  path: (obj: Record<string, unknown>, path: string, create?: boolean) => PathRef | null;
2245
2475
  move: (data: Record<string, unknown>, from: string, to: string) => boolean;
2246
2476
  remove: (data: Record<string, unknown>, path: string) => boolean;
@@ -2248,9 +2478,9 @@ interface Utils {
2248
2478
  fill: (target: Record<string, unknown>, defaults: Record<string, unknown>, mode?: 'merge' | 'cover') => void;
2249
2479
  }
2250
2480
  declare class migration {
2251
- static readonly log: (message: string, level?: string, ...objects: unknown[]) => void;
2481
+ static readonly log: ScopedLog;
2252
2482
  static create(): migration;
2253
- readonly log: (message: string, level?: string, ...objects: unknown[]) => void;
2483
+ readonly log: ScopedLog;
2254
2484
  readonly utils: Utils;
2255
2485
  steps: Step[];
2256
2486
  private readonly unsafeKeys;
@@ -2269,9 +2499,9 @@ interface RandState {
2269
2499
  index: number;
2270
2500
  }
2271
2501
  declare class randSystem {
2272
- static readonly log: (message: string, level?: string, ...objects: unknown[]) => void;
2502
+ static readonly log: ScopedLog;
2273
2503
  static create(state?: Partial<RandState>): randSystem;
2274
- readonly log: (message: string, level?: string, ...objects: unknown[]) => void;
2504
+ readonly log: ScopedLog;
2275
2505
  readonly state: RandState;
2276
2506
  private readonly maxHistory;
2277
2507
  private readonly modulus;
@@ -2333,15 +2563,13 @@ type MacroTags = string[] | null | undefined;
2333
2563
  type SkipArgs = string[] | boolean | null | undefined;
2334
2564
  declare class defineMacros {
2335
2565
  readonly manager: ToolCollection;
2336
- readonly log: ReturnType<typeof createlog>;
2566
+ readonly log: ScopedLog;
2337
2567
  readonly macros: string[];
2338
2568
  readonly statFunctions: Record<string, StatFunction>;
2339
2569
  constructor(manager: ToolCollection);
2340
- get Macro(): MaplebirchCore['SugarCube']['Macro'];
2570
+ get Macro(): ReturnType<MaplebirchCore['host']['sugarcube']['require']>['Macro'];
2341
2571
  define<Args extends unknown[]>(macroName: string, macroFunction: MacroFunction<Args>, tags?: MacroTags, skipArgs?: SkipArgs, isAsync?: boolean): void;
2342
2572
  defineS<Args extends unknown[]>(macroName: string, macroFunction: SimpleMacroFunction<Args>, tags?: MacroTags, skipArgs?: SkipArgs, maintainContext?: boolean): void;
2343
- statChange(statType: string, amount: number, colorClass: string, condition?: () => boolean): DocumentFragment;
2344
- grace(amount: number, expectedRank?: string): DocumentFragment;
2345
2573
  create<Args extends unknown[]>(name: string, fn: StatFunction<Args>): void;
2346
2574
  callStatFunction(name: string, ...args: unknown[]): DocumentFragment;
2347
2575
  }
@@ -2365,79 +2593,29 @@ declare class Builder {
2365
2593
  readonly context: TextContext;
2366
2594
  constructor(parent: htmlTools, fragment: HtmlRoot, context?: TextContext);
2367
2595
  text(content: TextContent, style?: string): this;
2368
- line(content?: TextContent, style?: string): this;
2369
- wikify(content: TextContent): this;
2370
- raw(content: RawContent): this;
2371
- box(content: RawContent, style?: string): this;
2372
- }
2373
- declare class htmlTools {
2374
- readonly core: MaplebirchCore;
2375
- readonly log: ReturnType<typeof createlog>;
2376
- private uid;
2377
- private readonly store;
2378
- constructor(core: MaplebirchCore);
2379
- get Wikifier(): MaplebirchCore['SugarCube']['Wikifier'];
2380
- replaceText(oldText: string, newText: string, root?: HtmlRoot | null): number;
2381
- renameLink(target: string | Element, label: string, root?: HtmlRoot | null): boolean;
2382
- replaceLink(target: string | Element, source: string, root?: HtmlRoot | null): boolean;
2383
- private findLink;
2384
- add(key: string, handler: (tools: Builder) => void, id?: string): string | false;
2385
- delete(key: string, idOrHandler?: string | ((tools: Builder) => void)): boolean;
2386
- clear(): void;
2387
- renderFragment(keys: string | string[], context?: TextContext): DocumentFragment;
2388
- renderInto(root: HtmlRoot, keys: string | string[], context?: TextContext): void;
2389
- render(macro: MacroContext$1, keys: string | string[]): void;
2390
- makeTextOutput(options?: { CSV?: boolean }): MacroFunction;
2391
- }
2392
- //#endregion
2393
- //#region src/modules/Addon/Diagnostics.d.ts
2394
- interface PatchResult {
2395
- kind: 'passage' | 'script' | 'style' | 'source';
2396
- target: string;
2397
- index: number;
2398
- pattern: string;
2399
- matches: number;
2400
- applied: number;
2401
- status: 'applied' | 'unmatched' | 'missing' | 'invalid' | 'mismatch' | 'error';
2402
- expected?: number;
2403
- error?: string;
2404
- }
2405
- interface ModRequirement {
2406
- name: string;
2407
- range?: string;
2408
- version?: string;
2409
- status: 'available' | 'missing' | 'incompatible' | 'invalid';
2410
- error?: string;
2411
- }
2412
- interface ModConflict {
2413
- source: string;
2414
- dataSource: string;
2415
- passages: string[];
2416
- scripts: string[];
2417
- styles: string[];
2418
- }
2419
- declare class Diagnostics {
2420
- private readonly manager;
2421
- private readonly modUtils;
2422
- private readonly results;
2423
- constructor(manager: SC2DataManager, modUtils: ModUtils);
2424
- get patches(): PatchResult[];
2425
- recordPatch(result: PatchResult): void;
2426
- clearPatches(): void;
2427
- mod(name: string, range?: string): ModRequirement;
2428
- dependencies(): boolean;
2429
- get conflicts(): ModConflict[] | undefined;
2430
- }
2431
- //#endregion
2432
- //#region src/modules/Frameworks/SourcePatch.d.ts
2433
- interface SourcePatch {
2434
- src?: string;
2435
- srcmatch?: RegExp;
2436
- srcmatchgroup?: RegExp;
2437
- to?: string;
2438
- applyafter?: string;
2439
- applybefore?: string;
2440
- expected?: number;
2596
+ line(content?: TextContent, style?: string): this;
2597
+ wikify(content: TextContent): this;
2598
+ raw(content: RawContent): this;
2599
+ box(content: RawContent, style?: string): this;
2600
+ }
2601
+ declare class htmlTools {
2602
+ readonly core: MaplebirchCore;
2603
+ readonly log: ScopedLog;
2604
+ private uid;
2605
+ private readonly store;
2606
+ constructor(core: MaplebirchCore);
2607
+ get Wikifier(): ReturnType<MaplebirchCore['host']['sugarcube']['require']>['Wikifier'];
2608
+ replaceText(oldText: string, newText: string, root?: HtmlRoot | null): number;
2609
+ renameLink(target: string | Element, label: string, root?: HtmlRoot | null): boolean;
2610
+ replaceLink(target: string | Element, source: string, root?: HtmlRoot | null): boolean;
2611
+ private findLink;
2612
+ add(key: string, handler: (tools: Builder) => void, id?: string): string | false;
2613
+ delete(key: string, idOrHandler?: string | ((tools: Builder) => void)): boolean;
2614
+ clear(): void;
2615
+ renderFragment(keys: string | string[], context?: TextContext): DocumentFragment;
2616
+ renderInto(root: HtmlRoot, keys: string | string[], context?: TextContext): void;
2617
+ render(macro: MacroContext$1, keys: string | string[]): void;
2618
+ makeTextOutput(options?: { CSV?: boolean }): MacroFunction;
2441
2619
  }
2442
2620
  //#endregion
2443
2621
  //#region src/modules/Frameworks/ZonesManager.d.ts
@@ -2474,8 +2652,8 @@ interface CustomLinkGroup {
2474
2652
  }
2475
2653
  type InitFunction = string | ZoneFunction | InitObject;
2476
2654
  declare class zonesManager {
2477
- readonly log: ReturnType<typeof createlog>;
2478
- readonly core: ToolCollection['core'];
2655
+ readonly log: ScopedLog;
2656
+ readonly core: MaplebirchCore;
2479
2657
  data: Record<string, ZoneItem[]>;
2480
2658
  initFunction: InitFunction[];
2481
2659
  specialWidget: (string | ZoneFunction)[];
@@ -2486,14 +2664,14 @@ declare class zonesManager {
2486
2664
  private readonly functions;
2487
2665
  private readonly functionNames;
2488
2666
  private nextFunction;
2489
- constructor(manager: ToolCollection);
2667
+ constructor(core: MaplebirchCore);
2490
2668
  inject(...databases: Partial<Pick<zonesManager, 'specialWidget' | 'defaultData' | 'locationPassage' | 'widgetPassage'>>[]): void;
2491
2669
  onInit(...widgets: InitFunction[]): void;
2492
2670
  addTo(zone: string, ...widgets: ZoneWidget[]): void;
2493
2671
  storyInit(): void;
2494
2672
  call(name: string): unknown;
2495
2673
  play(zone: 'CustomLinkZone', passageTitle?: string): CustomLinkGroup[];
2496
- play(zone: 'BeforeLinkZone' | 'AfterLinkZone', passageTitle?: string): string;
2674
+ play(zone: 'State' | 'BeforeLinkZone' | 'AfterLinkZone', passageTitle?: string): string;
2497
2675
  play(zone: string, passageTitle?: string): string | CustomLinkGroup[];
2498
2676
  patchModToGame(manager: AddonPlugin, type: 'before' | 'after'): void;
2499
2677
  private get widgets();
@@ -2524,7 +2702,6 @@ interface LinkZoneConfig {
2524
2702
  onAfterApply?: ((result: boolean, config: LinkZoneConfig) => void) | null;
2525
2703
  debug: boolean;
2526
2704
  }
2527
- declare const log: (message: string, level?: string, ...objects: unknown[]) => void;
2528
2705
  declare class LinkZoneManager {
2529
2706
  readonly containerId: string;
2530
2707
  readonly linkSelector: string;
@@ -2535,8 +2712,8 @@ declare class LinkZoneManager {
2535
2712
  lastLink: Element | null;
2536
2713
  links: Element[];
2537
2714
  breakBeforeFirst: ChildNode | null;
2538
- readonly log: ReturnType<typeof createlog>;
2539
- constructor(containerId?: string, linkSelector?: string, logger?: typeof log);
2715
+ readonly log: ScopedLog;
2716
+ constructor(containerId: string | undefined, linkSelector: string | undefined, logger: ScopedLog);
2540
2717
  detect(): boolean;
2541
2718
  applyZones(config: LinkZoneConfig, customZones: CustomZone[]): boolean;
2542
2719
  private applyBefore;
@@ -2550,7 +2727,7 @@ declare class LinkZoneManager {
2550
2727
  }
2551
2728
  declare const applyLinkZone: typeof LinkZoneManager;
2552
2729
  //#endregion
2553
- //#region src/modules/Frameworks/Patches/Patch.d.ts
2730
+ //#region src/modules/Frameworks/Patch.d.ts
2554
2731
  type PatchPhase = 'init' | 'state';
2555
2732
  interface WidgetPatch {
2556
2733
  before?: (text: string) => string;
@@ -2566,8 +2743,7 @@ interface PatchDefinition<T extends object = object, Flat extends object = T> {
2566
2743
  }
2567
2744
  declare class Patch<Extensions extends Record<string, object> = Record<never, never>> {
2568
2745
  private readonly report;
2569
- private readonly entries;
2570
- private readonly extensionValues;
2746
+ private readonly definitions;
2571
2747
  constructor(report: (name: string, error: unknown) => void);
2572
2748
  add<T extends object, Flat extends object = T>(name: string, definition: PatchDefinition<T, Flat>): this & Flat;
2573
2749
  get<Name extends keyof Extensions>(name: Name): Extensions[Name] | undefined;
@@ -2584,56 +2760,318 @@ declare class Patch<Extensions extends Record<string, object> = Record<never, ne
2584
2760
  apply(phase: PatchPhase): void;
2585
2761
  }
2586
2762
  //#endregion
2587
- //#region src/modules/Frameworks/Patches/Tips.d.ts
2763
+ //#region src/modules/ToolCollection.d.ts
2764
+ type ToolConstructors = {
2765
+ console?: new (manager: ToolCollection) => CheatConsole;
2766
+ macro?: new (manager: ToolCollection) => defineMacros;
2767
+ };
2768
+ declare class ToolCollection {
2769
+ readonly core: MaplebirchCore;
2770
+ readonly log: ScopedLog;
2771
+ readonly console: CheatConsole;
2772
+ readonly migration: typeof migration;
2773
+ readonly rand: typeof randSystem;
2774
+ readonly macro: defineMacros;
2775
+ readonly text: htmlTools;
2776
+ readonly zone: zonesManager;
2777
+ readonly link: typeof applyLinkZone;
2778
+ readonly patch: Patch;
2779
+ constructor(core: MaplebirchCore, constructors?: ToolConstructors);
2780
+ onInit(...widgets: InitFunction[]): void;
2781
+ addTo(zone: string, ...widgets: ZoneWidget[]): void;
2782
+ inject(...databases: Parameters<zonesManager['inject']>): void;
2783
+ }
2784
+ //#endregion
2785
+ //#region src/host/DoL.d.ts
2786
+ type DoLVariables = typeof V;
2787
+ type DoLTemporary = typeof T;
2788
+ type DoLCharacters = typeof C;
2789
+ type DoLSetup = typeof setup;
2790
+ type DoLRenderer = typeof Renderer;
2791
+ type DoLGlobalName = 'V' | 'T' | 'C' | 'setup' | 'Renderer' | 'variables' | 'temporary' | 'characters' | 'renderer';
2792
+ interface DoLHost {
2793
+ readonly V: DoLVariables;
2794
+ readonly T: DoLTemporary;
2795
+ readonly C: DoLCharacters;
2796
+ readonly setup: DoLSetup;
2797
+ readonly Renderer: DoLRenderer;
2798
+ readonly variables: DoLVariables;
2799
+ readonly temporary: DoLTemporary;
2800
+ readonly characters: DoLCharacters;
2801
+ readonly renderer: DoLRenderer;
2802
+ readonly gameVersion: string;
2803
+ has(name: DoLGlobalName): boolean;
2804
+ }
2805
+ interface DoLGlobalScope {
2806
+ V?: DoLVariables;
2807
+ T?: DoLTemporary;
2808
+ C?: DoLCharacters;
2809
+ setup?: DoLSetup;
2810
+ Renderer?: DoLRenderer;
2811
+ }
2812
+ export declare class DoL implements DoLHost {
2813
+ private readonly scope;
2814
+ constructor(scope?: DoLGlobalScope);
2815
+ get V(): DoLVariables;
2816
+ get T(): DoLTemporary;
2817
+ get C(): DoLCharacters;
2818
+ get setup(): DoLSetup;
2819
+ get Renderer(): DoLRenderer;
2820
+ get variables(): DoLVariables;
2821
+ get temporary(): DoLTemporary;
2822
+ get characters(): DoLCharacters;
2823
+ get renderer(): DoLRenderer;
2824
+ get gameVersion(): string;
2825
+ has(name: DoLGlobalName): boolean;
2826
+ private require;
2827
+ }
2828
+ declare const dol: DoL;
2829
+ //#endregion
2830
+ //#region src/modules/TimeStateWeather/TimeEvents.d.ts
2831
+ type TimeEventType = 'onSec' | 'onMin' | 'onHour' | 'onDay' | 'onWeek' | 'onMonth' | 'onYear' | 'onBefore' | 'onThread' | 'onAfter' | 'onTimeTravel';
2832
+ type TimeUnit = 'sec' | 'min' | 'hour' | 'day' | 'week' | 'month' | 'year';
2833
+ interface AccumulateConfig {
2834
+ unit: TimeUnit;
2835
+ target?: number;
2836
+ }
2837
+ interface TimeData {
2838
+ prevDate?: DateTime;
2839
+ currentDate?: DateTime;
2840
+ changes?: Record<TimeUnit, number>;
2841
+ triggeredByAccumulator?: {
2842
+ unit: TimeUnit;
2843
+ target: number;
2844
+ count: number;
2845
+ };
2846
+ exactPoints?: {
2847
+ min: boolean;
2848
+ hour: boolean;
2849
+ day: boolean;
2850
+ week: boolean;
2851
+ month: boolean;
2852
+ year: boolean;
2853
+ };
2854
+ passed?: number;
2855
+ sec?: number;
2856
+ min?: number;
2857
+ hour?: number;
2858
+ day?: number;
2859
+ week?: number;
2860
+ month?: number;
2861
+ year?: number;
2862
+ weekday?: [number, number];
2863
+ detailedDiff?: ReturnType<DateTime['compareWith']>;
2864
+ timeStamp?: number;
2865
+ prev?: DateTime;
2866
+ current?: DateTime;
2867
+ diffSeconds?: number;
2868
+ direction?: 'forward' | 'backward';
2869
+ isLeap?: boolean;
2870
+ }
2871
+ interface TimeEventOptions extends EventOptions {
2872
+ action?: (data: TimeData) => void;
2873
+ cond?: (data: TimeData) => boolean;
2874
+ accumulate?: AccumulateConfig;
2875
+ exact?: boolean;
2876
+ }
2877
+ interface TimeTravelOptions {
2878
+ target?: DateTime;
2879
+ year?: number;
2880
+ month?: number;
2881
+ day?: number;
2882
+ hour?: number;
2883
+ minute?: number;
2884
+ second?: number;
2885
+ addYears?: number;
2886
+ addMonths?: number;
2887
+ addDays?: number;
2888
+ addHours?: number;
2889
+ addMinutes?: number;
2890
+ addSeconds?: number;
2891
+ }
2892
+ declare class TimeEvent extends Event {
2893
+ readonly type: TimeEventType;
2894
+ protected readonly eventName = 'TimeEvent';
2895
+ private action?;
2896
+ private cond;
2897
+ private exact;
2898
+ private accumulate?;
2899
+ private accumulated;
2900
+ private target;
2901
+ constructor(id: string, type: TimeEventType, options: TimeEventOptions, log: DoLDynamic['log']);
2902
+ tryRun(data: TimeData, accumulatedOnly?: boolean): boolean;
2903
+ private runAccumulated;
2904
+ private execute;
2905
+ private match;
2906
+ private runAction;
2907
+ private isExactPoint;
2908
+ }
2909
+ declare class TimeManager {
2910
+ private readonly manager;
2911
+ private readonly timeEvents;
2912
+ private readonly travelHooks;
2913
+ readonly log: DoLDynamic['log'];
2914
+ readonly TimeConstants: Readonly<{
2915
+ secondsPerDay: 86400;
2916
+ secondsPerHour: 3600;
2917
+ secondsPerMinute: 60;
2918
+ minutesPerHour: 60;
2919
+ standardYearMonths: readonly number[];
2920
+ leapYearMonths: readonly number[];
2921
+ synodicMonth: 29.53058867;
2922
+ MIN_DATE: Readonly<{
2923
+ timeStamp: -315537984000;
2924
+ year: -9999;
2925
+ month: 1;
2926
+ day: 1;
2927
+ hour: 0;
2928
+ minute: 0;
2929
+ second: 0;
2930
+ }>;
2931
+ MAX_DATE: Readonly<{
2932
+ timeStamp: 315537897599;
2933
+ year: 9999;
2934
+ month: 12;
2935
+ day: 31;
2936
+ hour: 23;
2937
+ minute: 59;
2938
+ second: 59;
2939
+ }>;
2940
+ }>;
2941
+ constructor(manager: DoLDynamic);
2942
+ get events(): Readonly<Record<string, ReadonlyMap<string, TimeEvent>>>;
2943
+ Init(): void;
2944
+ patchDateTime(DateTimeClass: typeof DateTime): typeof DateTime;
2945
+ patchTime(TimeObject: typeof Time): void;
2946
+ register(type: TimeEventType, eventId: string, options: TimeEventOptions): boolean;
2947
+ unregister(type: string, eventId: string): boolean;
2948
+ onTravel(name: string, callback: (data: TimeData) => void): boolean;
2949
+ timeTravel(options?: TimeTravelOptions): boolean;
2950
+ updateTimeLanguage(choice?: 'JournalTime'): string | boolean;
2951
+ private handleTimePass;
2952
+ private handleTimeTravel;
2953
+ private targetDate;
2954
+ private timeData;
2955
+ private triggerUnitEvents;
2956
+ private trigger;
2957
+ }
2958
+ //#endregion
2959
+ //#region src/modules/TimeStateWeather/WeatherEvents.d.ts
2960
+ interface WeatherEventOptions extends EventOptions {
2961
+ condition?: () => boolean;
2962
+ onEnter?: () => void;
2963
+ onExit?: () => void;
2964
+ [key: string]: any;
2965
+ }
2966
+ interface WeatherTypeConfig {
2967
+ name: string;
2968
+ iconType?: string | (() => string);
2969
+ value: number;
2970
+ probability: {
2971
+ summer: number;
2972
+ winter: number;
2973
+ spring: number;
2974
+ autumn: number;
2975
+ };
2976
+ cloudCount: {
2977
+ small: () => number;
2978
+ large: () => number;
2979
+ };
2980
+ tanningModifier: number;
2981
+ overcast: number | (() => number);
2982
+ precipitationIntensity: number;
2983
+ visibility: number;
2984
+ }
2985
+ interface WeatherException {
2986
+ date: () => DateTime;
2987
+ duration: number;
2988
+ weatherType: string;
2989
+ temperature?: number;
2990
+ }
2991
+ declare class WeatherManager {
2992
+ private readonly manager;
2993
+ private readonly weatherEvents;
2994
+ private readonly activeEvents;
2995
+ private readonly Exceptions;
2996
+ private readonly WeatherTypes;
2997
+ private readonly layerModifications;
2998
+ private readonly effectModifications;
2999
+ private weatherTriggered;
3000
+ private readonly log;
3001
+ constructor(manager: DoLDynamic);
3002
+ private refresh;
3003
+ private checkEvents;
3004
+ register(eventId: string, options: WeatherEventOptions): boolean;
3005
+ unregister(eventId: string): boolean;
3006
+ addLayer(layerName: string, patch: any, mode?: 'concat' | 'replace' | 'merge'): this;
3007
+ addEffect(effectName: string, patch: any, mode?: 'concat' | 'replace' | 'merge'): this;
3008
+ applyModifications(params: any): any;
3009
+ addWeatherData(data: WeatherException | WeatherTypeConfig): boolean | void;
3010
+ Init(): void;
3011
+ modifyWeatherJavaScript(manager: AddonPlugin): void;
3012
+ }
3013
+ //#endregion
3014
+ //#region src/modules/DoL/Dynamic.d.ts
3015
+ declare class DoLDynamic extends Dynamic {
3016
+ get State(): StateManager;
3017
+ get Time(): TimeManager;
3018
+ get Weather(): WeatherManager;
3019
+ regStateEvent(type: 'gate' | 'append', eventId: string, options: StateEventOptions): boolean;
3020
+ delStateEvent(type: 'gate' | 'append', eventId: string): boolean;
3021
+ trigger(type: 'gate' | 'append'): string;
3022
+ get StateEvents(): StateManager['events'];
3023
+ regTimeEvent(type: TimeEventType, eventId: string, options: TimeEventOptions): boolean;
3024
+ delTimeEvent(type: TimeEventType, eventId: string): boolean;
3025
+ timeTravel(options?: TimeTravelOptions): boolean;
3026
+ get TimeEvents(): TimeManager['events'];
3027
+ regWeatherEvent(eventId: string, options: WeatherEventOptions): boolean;
3028
+ delWeatherEvent(eventId: string): boolean;
3029
+ addWeather(data: WeatherException | WeatherTypeConfig): boolean | void;
3030
+ Init(): void;
3031
+ private fixDynamicTask;
3032
+ }
3033
+ //#endregion
3034
+ //#region src/modules/Frameworks/TimeTravelCheat.d.ts
3035
+ declare class TimeTravelCheat {
3036
+ private readonly core;
3037
+ private readonly ids;
3038
+ constructor(core: MaplebirchCore);
3039
+ fragment(): DocumentFragment;
3040
+ private createRoot;
3041
+ private bind;
3042
+ private render;
3043
+ private fieldInput;
3044
+ private setFields;
3045
+ private readFields;
3046
+ private syncDayLimit;
3047
+ private travel;
3048
+ private status;
3049
+ }
3050
+ //#endregion
3051
+ //#region src/modules/Frameworks/DoLConsole.d.ts
3052
+ declare class DoLConsole extends CheatConsole {
3053
+ readonly timeTravel: TimeTravelCheat;
3054
+ constructor(manager: ToolCollection);
3055
+ }
3056
+ //#endregion
3057
+ //#region src/modules/Frameworks/DoLMacros.d.ts
3058
+ declare class DoLMacros extends defineMacros {
3059
+ statChange(statType: string, amount: number, colorClass: string, condition?: () => boolean): DocumentFragment;
3060
+ grace(amount: number, expectedRank?: string): DocumentFragment;
3061
+ }
3062
+ //#endregion
3063
+ //#region src/modules/DoL/Patches/Tips.d.ts
2588
3064
  declare class Tips {
2589
3065
  static add(category: string, ...tips: string[]): void;
2590
3066
  static apply(): void;
2591
3067
  static inject(data: string[]): string[];
2592
3068
  }
2593
3069
  //#endregion
2594
- //#region src/modules/Frameworks/Patches/index.d.ts
2595
- declare function create(core: MaplebirchCore): (Patch<{
2596
- traits: {
2597
- data: TraitConfig[];
2598
- add: typeof Traits.add;
2599
- inject: (data: Parameters<typeof Traits.inject>[0]) => TraitCategory[];
2600
- };
2601
- location: {
2602
- data: Record<string, LocationUpdate>;
2603
- configure: typeof Location.configure;
2604
- apply: typeof Location.apply;
2605
- };
2606
- bodywriting: {
2607
- data: Record<string, BodywritingData>;
2608
- add: typeof Bodywriting.add;
2609
- delete: typeof Bodywriting.delete;
2610
- apply: typeof Bodywriting.apply;
2611
- };
2612
- fishing: {
2613
- data: Record<string, FishConfig>;
2614
- locations: Partial<Record<FishingLocation, Record<string, number>>>;
2615
- add: typeof Fishing.addFish;
2616
- addBait: typeof Fishing.addBait;
2617
- configure: typeof Fishing.configureLocation;
2618
- apply: typeof Fishing.apply;
2619
- };
2620
- foodstuff: {
2621
- data: Record<string, FoodstuffConfig>;
2622
- add: typeof Foodstuff.add;
2623
- apply: typeof Foodstuff.apply;
2624
- };
2625
- antiques: {
2626
- data: Record<string, AntiqueConfig>;
2627
- add: typeof Antiques.add;
2628
- inject: typeof Antiques.inject;
2629
- };
2630
- tips: {
2631
- data: Record<string, string[]>;
2632
- add: typeof Tips.add;
2633
- apply: typeof Tips.apply;
2634
- inject: typeof Tips.inject;
2635
- };
2636
- }> & {
3070
+ //#region src/modules/DoL/Patches/index.d.ts
3071
+ declare function register(
3072
+ core: MaplebirchCore,
3073
+ patch: Patch
3074
+ ): (Patch<Record<never, never>> & {
2637
3075
  traitsData: TraitConfig[];
2638
3076
  addTraits: typeof Traits.add;
2639
3077
  injectTraits: (data: Parameters<typeof Traits.inject>[0]) => TraitCategory[];
@@ -2708,24 +3146,19 @@ declare function create(core: MaplebirchCore): (Patch<{
2708
3146
  inject: typeof Tips.inject;
2709
3147
  };
2710
3148
  };
2711
- type Patches = ReturnType<typeof create>;
3149
+ type Patches = ReturnType<typeof register>;
2712
3150
  //#endregion
2713
- //#region src/modules/ToolCollection.d.ts
2714
- declare class ToolCollection {
2715
- readonly core: MaplebirchCore;
2716
- readonly console: CheatConsole;
2717
- readonly migration: typeof migration;
2718
- readonly rand: typeof randSystem;
2719
- readonly macro: defineMacros;
2720
- readonly text: htmlTools;
2721
- readonly zone: zonesManager;
2722
- readonly link: typeof applyLinkZone;
3151
+ //#region src/modules/DoL/ToolCollection.d.ts
3152
+ declare class DoLToolCollection extends ToolCollection {
3153
+ readonly console: DoLConsole;
3154
+ readonly macro: DoLMacros;
2723
3155
  readonly patch: Patches;
2724
- readonly createlog: typeof createlog;
3156
+ private readonly macros;
3157
+ private readonly optionEvents;
3158
+ private readonly modI18N;
2725
3159
  constructor(core: MaplebirchCore);
2726
- onInit(...widgets: InitFunction[]): void;
2727
- addTo(zone: string, ...widgets: ZoneWidget[]): void;
2728
3160
  preInit(): void;
3161
+ Init(): void;
2729
3162
  }
2730
3163
  //#endregion
2731
3164
  //#region src/modules/AudioAddon/Track.d.ts
@@ -2773,6 +3206,22 @@ declare class Playlist {
2773
3206
  private shuffle;
2774
3207
  }
2775
3208
  //#endregion
3209
+ //#region src/modules/AudioAddon/Ambience.d.ts
3210
+ declare class Ambience {
3211
+ private readonly modloader;
3212
+ private active;
3213
+ private request;
3214
+ constructor(modloader: ModLoader);
3215
+ protected create(options: HowlOptions): Howl;
3216
+ play(modName: string, path: string, volume?: number, fadeMs?: number): Promise<boolean>;
3217
+ setVolume(volume: number, fadeMs?: number): void;
3218
+ stop(fadeMs?: number): void;
3219
+ private fadeOut;
3220
+ private dispose;
3221
+ private clamp;
3222
+ private duration;
3223
+ }
3224
+ //#endregion
2776
3225
  //#region src/modules/Audio.d.ts
2777
3226
  declare const PlayState: {
2778
3227
  readonly IDLE: 'idle';
@@ -2804,9 +3253,10 @@ interface AudioSnapshot {
2804
3253
  muted: boolean;
2805
3254
  progress: AudioProgress;
2806
3255
  }
2807
- declare class AudioManager {
3256
+ declare class Audio {
2808
3257
  readonly core: MaplebirchCore;
2809
- readonly log: ReturnType<typeof createlog>;
3258
+ readonly log: ScopedLog;
3259
+ readonly ambience: Ambience;
2810
3260
  private readonly STORE;
2811
3261
  private readonly playlists;
2812
3262
  private readonly playlistLoads;
@@ -2903,7 +3353,7 @@ declare class Variables {
2903
3353
  static get options(): Record<string, any>;
2904
3354
  version: string;
2905
3355
  readonly tool: MaplebirchCore['tool'];
2906
- readonly log: ReturnType<typeof createlog>;
3356
+ readonly log: ScopedLog;
2907
3357
  readonly migration: migration;
2908
3358
  readonly options: Options;
2909
3359
  constructor(core: MaplebirchCore);
@@ -2913,6 +3363,7 @@ declare class Variables {
2913
3363
  Init(): void;
2914
3364
  loadInit(): void;
2915
3365
  postInit(): void;
3366
+ private run;
2916
3367
  }
2917
3368
  //#endregion
2918
3369
  //#region src/modules/CharacterAddon/Pet.d.ts
@@ -3015,7 +3466,7 @@ interface TransformationOption extends EntryOptions {
3015
3466
  }
3016
3467
  declare class Transformation {
3017
3468
  private manager;
3018
- private log;
3469
+ private get log();
3019
3470
  private config;
3020
3471
  readonly decayConditions: Record<string, DecayCondition[]>;
3021
3472
  readonly suppressConditions: Record<string, SuppressCondition[]>;
@@ -3061,10 +3512,11 @@ interface LayerUseOptions {
3061
3512
  declare function mask(x?: number, rotation?: number, swap?: boolean, width?: number, height?: number): string;
3062
3513
  declare class Character {
3063
3514
  readonly core: MaplebirchCore;
3064
- readonly log: ReturnType<typeof createlog>;
3515
+ readonly log: ScopedLog;
3065
3516
  readonly mask: typeof mask;
3066
3517
  readonly faceStyleMap: Map<string, string[]>;
3067
- private readonly handlers;
3518
+ private readonly processors;
3519
+ private nextProcessor;
3068
3520
  private readonly layers;
3069
3521
  readonly pet: Pet;
3070
3522
  readonly transformation: Transformation;
@@ -3426,6 +3878,11 @@ interface WardrobeWearOptions {
3426
3878
  when?: Condition;
3427
3879
  wetness?: WardrobeWetnessResolver;
3428
3880
  }
3881
+ interface WardrobeConditionGroup {
3882
+ location?: string | readonly string[];
3883
+ passage?: string | readonly string[];
3884
+ hours?: readonly [from: number, to: number];
3885
+ }
3429
3886
  type WardrobeWeightedChoice = readonly [key: string, weight: number];
3430
3887
  type WardrobeChoice = string | readonly WardrobeWeightedChoice[];
3431
3888
  type WardrobeLayerResolver = string | (() => string);
@@ -3440,16 +3897,19 @@ declare class NPCSidebarWardrobe {
3440
3897
  private readonly manager;
3441
3898
  private readonly templates;
3442
3899
  private readonly profiles;
3900
+ private readonly conditions;
3443
3901
  constructor(manager: NPCManager);
3444
3902
  init(): void;
3445
3903
  load(modName: string, filePath: string): Promise<void>;
3446
3904
  get(key: string): WardrobeItem | undefined;
3447
3905
  set(key: string, template: WardrobeItem): void;
3448
3906
  has(key: string): boolean;
3907
+ when(name: string, group?: WardrobeConditionGroup, condition?: Condition): () => boolean;
3449
3908
  wear(npcName: string, location: string | readonly string[], choice: WardrobeChoice, options?: Condition | WardrobeWearOptions): void;
3450
3909
  wet(npcName: string, wetness: WardrobeWetnessResolver, cond?: Condition): void;
3451
3910
  layer(npcName: string, source: WardrobeLayerResolver, cond?: Condition): void;
3452
- put(clothes: WardrobeItem, key: string): void;
3911
+ apply(clothes: WardrobeItem, slot: NPCClothesSlot, item: WardrobeClothing): void;
3912
+ put(clothes: WardrobeItem, key: string, slots?: NPCClothesSlot | readonly NPCClothesSlot[]): void;
3453
3913
  strip(clothes: WardrobeItem, slot: NPCClothesSlot | readonly NPCClothesSlot[]): void;
3454
3914
  base(npcName: string, modifier: WardrobeModifier): void;
3455
3915
  modify(npcName: string, modifier: WardrobeModifier): void;
@@ -3798,7 +4258,7 @@ declare const NamedNPC: {
3798
4258
  };
3799
4259
  declare class NPCManager {
3800
4260
  readonly core: MaplebirchCore;
3801
- readonly log: ReturnType<typeof createlog>;
4261
+ readonly log: ScopedLog;
3802
4262
  readonly data: Map<
3803
4263
  string,
3804
4264
  {
@@ -3836,18 +4296,23 @@ declare class NPCManager {
3836
4296
  postInit(): void;
3837
4297
  }
3838
4298
  //#endregion
3839
- //#region src/modules/CombatAddon/CombatAction.d.ts
4299
+ //#region src/modules/CombatAddon/CombatTypes.d.ts
3840
4300
  declare const actionTypes: readonly ['leftaction', 'rightaction', 'feetaction', 'mouthaction', 'penisaction', 'vaginaaction', 'anusaction', 'chestaction', 'thighaction'];
3841
4301
  type ActionType = (typeof actionTypes)[number];
3842
- type CombatType = 'Default' | 'Self' | 'Struggle' | 'Swarm' | 'Vore' | 'Machine' | 'Tentacle';
4302
+ declare const combatTypes: readonly ['Default', 'Self', 'Struggle', 'Swarm', 'Vore', 'Machine', 'Tentacle'];
4303
+ type CombatType = (typeof combatTypes)[number];
4304
+ //#endregion
4305
+ //#region src/modules/CombatAddon/CombatAction.d.ts
4306
+ type OptionType = ActionType | 'ask';
3843
4307
  type ActionValue = string | number;
3844
4308
  interface Context {
3845
- actionType?: ActionType;
4309
+ actionType?: OptionType;
3846
4310
  combatType?: CombatType;
3847
4311
  encounterType?: CombatType;
3848
4312
  action?: ActionValue;
3849
4313
  id?: string;
3850
4314
  originalCount?: number;
4315
+ label?: string;
3851
4316
  }
3852
4317
  interface ActionEntry {
3853
4318
  id: string;
@@ -3858,7 +4323,7 @@ interface ActionEntry {
3858
4323
  color: (ctx: Context) => string;
3859
4324
  difficulty: (ctx: Context) => string;
3860
4325
  effect: (ctx: Context) => string;
3861
- combatType: (ctx: Context) => CombatType;
4326
+ combatType: (ctx: Context) => CombatType | CombatType[];
3862
4327
  order: (ctx: Context) => number;
3863
4328
  }
3864
4329
  interface ActionConfig {
@@ -3870,7 +4335,16 @@ interface ActionConfig {
3870
4335
  color?: string | ((ctx: Context) => string);
3871
4336
  difficulty?: string | ((ctx: Context) => string);
3872
4337
  effect?: string | ((ctx: Context) => string);
3873
- combatType?: CombatType | ((ctx: Context) => CombatType);
4338
+ combatType?: CombatType | CombatType[] | ((ctx: Context) => CombatType | CombatType[]);
4339
+ order?: number | ((ctx: Context) => number);
4340
+ }
4341
+ interface ModificationConfig {
4342
+ id: string;
4343
+ actionType: OptionType | OptionType[];
4344
+ value: ActionValue;
4345
+ combatType?: CombatType | CombatType[] | ((ctx: Context) => CombatType | CombatType[]);
4346
+ cond?: (ctx: Context) => boolean;
4347
+ display?: string | ((ctx: Context) => string);
3874
4348
  order?: number | ((ctx: Context) => number);
3875
4349
  }
3876
4350
  interface OptionsTable {
@@ -3878,18 +4352,21 @@ interface OptionsTable {
3878
4352
  }
3879
4353
  declare class CombatActions {
3880
4354
  readonly actions: ActionEntry[];
4355
+ private readonly modifications;
4356
+ private matches;
3881
4357
  reg(...configs: ActionConfig[]): this;
4358
+ modify(...configs: ModificationConfig[]): this;
3882
4359
  private eval;
3883
- patchOptions(optionsTable: OptionsTable, actionType: ActionType, combatType?: CombatType): OptionsTable;
4360
+ patchOptions(optionsTable: OptionsTable, actionType: OptionType, combatType?: CombatType): OptionsTable;
3884
4361
  color(action: ActionValue, encounterType?: CombatType): string | null;
3885
4362
  difficulty(action: ActionValue, combatType?: CombatType): string | null;
3886
- effect(...actionTypes: ActionType[]): string;
4363
+ effect(combatType: CombatType | undefined, ...actionTypes: ActionType[]): string;
3887
4364
  }
3888
4365
  //#endregion
3889
4366
  //#region src/modules/Combat.d.ts
3890
- declare class CombatManager {
4367
+ declare class Combat {
3891
4368
  readonly core: MaplebirchCore;
3892
- readonly log: ReturnType<typeof createlog>;
4369
+ readonly log: ScopedLog;
3893
4370
  readonly CombatAction: CombatActions;
3894
4371
  constructor(core: MaplebirchCore);
3895
4372
  private _generateCombatAction;
@@ -3898,287 +4375,67 @@ declare class CombatManager {
3898
4375
  Init(): void;
3899
4376
  }
3900
4377
  //#endregion
3901
- //#region src/core.d.ts
3902
- interface Extensions {}
4378
+ //#region src/modules/DoL/types.d.ts
3903
4379
  interface CoreModules {
3904
- readonly addon: AddonPlugin;
3905
- readonly dynamic: DynamicManager;
3906
- readonly tool: ToolCollection;
3907
- readonly audio: AudioManager;
4380
+ readonly dynamic: DoLDynamic;
4381
+ readonly tool: DoLToolCollection;
4382
+ readonly audio: Audio;
3908
4383
  readonly var: Variables;
3909
4384
  readonly char: Character;
3910
4385
  readonly npc: NPCManager;
3911
- readonly combat: CombatManager;
3912
- }
3913
- interface CoreEvents {
3914
- ':indexedDB': [];
3915
- ':idbReady': [];
3916
- ':import': [];
3917
- ':variable': [];
3918
- ':onSave': [save: Save];
3919
- ':onLoad': [save: Save];
3920
- ':language': [];
3921
- ':storyready': [];
3922
- ':passageinit': [passage: Passage];
3923
- ':passagestart': [passage: Passage, content: HTMLDivElement];
3924
- ':passagerender': [passage: Passage, content: HTMLDivElement];
3925
- ':passagedisplay': [passage: Passage, content: HTMLDivElement];
3926
- ':passageend': [passage: Passage, content: HTMLDivElement];
3927
- ':sugarcube': [];
3928
- ':modLoaderEnd': [];
3929
- }
3930
- type Instance = MaplebirchCore & Extensions;
3931
- declare class MaplebirchCore {
3932
- static meta: {
3933
- name: 'maplebirch Frameworks';
3934
- author: string;
3935
- version: string;
3936
- modifiedby: string;
3937
- updateDate: string;
3938
- Languages: typeof Languages;
3939
- early: readonly string[];
3940
- core: readonly string[];
3941
- protected: readonly string[];
3942
- };
3943
- readonly meta: typeof MaplebirchCore.meta;
3944
- readonly utils: Readonly<{
3945
- clone: typeof clone;
3946
- equal: typeof equal;
3947
- merge: typeof merge;
3948
- append: typeof append;
3949
- cover: typeof cover;
3950
- mergefn: typeof mergeFn;
3951
- appendfn: typeof appendFn;
3952
- coverfn: typeof coverFn;
3953
- contains: typeof contains;
3954
- random: typeof randomNumber;
3955
- either: typeof randomPick;
3956
- SelectCase: typeof SelectCase;
3957
- convert: typeof convert;
3958
- clamp: typeof clamp;
3959
- loadImage: typeof loadImage;
3960
- }>;
3961
- readonly modList: string[];
3962
- readonly manager: {
3963
- modSC2DataManager: SC2DataManager;
3964
- modLoaderGui: Gui;
3965
- };
3966
- passage: Passage;
3967
- readonly yaml: typeof jsyaml;
3968
- readonly howler: {
3969
- Howl: typeof Howl;
3970
- Howler: typeof Howler;
3971
- };
3972
- readonly logger: Logger;
3973
- readonly tracer: EventEmitter;
3974
- readonly idb: IndexedDBService;
3975
- readonly credential: CredentialVault;
3976
- readonly cloudSave: CloudSaveService;
3977
- readonly lang: LanguageManager;
3978
- readonly modules: ModuleSystem;
3979
- readonly gui: GUIControl;
3980
- readonly addon: CoreModules['addon'];
3981
- readonly dynamic: CoreModules['dynamic'];
3982
- readonly tool: CoreModules['tool'];
3983
- readonly audio: CoreModules['audio'];
3984
- readonly var: CoreModules['var'];
3985
- readonly char: CoreModules['char'];
3986
- readonly npc: CoreModules['npc'];
3987
- readonly combat: CoreModules['combat'];
3988
- constructor(modSC2DataManager: SC2DataManager, modLoaderGui: Gui);
3989
- log(msg: string, level?: string, ...objs: unknown[]): void;
3990
- on<Name extends keyof CoreEvents>(eventName: Name, callback: EventCallback<CoreEvents[Name]>, description?: string): boolean;
3991
- on<Name extends string, Args extends unknown[]>(eventName: Name extends keyof CoreEvents ? never : Name, callback: EventCallback<Args>, description?: string): boolean;
3992
- off<Args extends unknown[]>(eventName: string, identifier: string | EventCallback<Args>): boolean;
3993
- once<Name extends keyof CoreEvents>(eventName: Name, callback: EventCallback<CoreEvents[Name]>, description?: string): boolean;
3994
- once<Name extends string, Args extends unknown[]>(eventName: Name extends keyof CoreEvents ? never : Name, callback: EventCallback<Args>, description?: string): boolean;
3995
- after<Name extends keyof CoreEvents>(eventName: Name, callback: EventCallback<CoreEvents[Name]>): void;
3996
- after<Name extends string, Args extends unknown[]>(eventName: Name extends keyof CoreEvents ? never : Name, callback: EventCallback<Args>): void;
3997
- trigger<Name extends keyof CoreEvents>(eventName: Name, ...args: CoreEvents[Name]): Promise<void>;
3998
- trigger<Name extends string>(eventName: Name extends keyof CoreEvents ? never : Name, ...args: unknown[]): Promise<void>;
3999
- register<T extends object>(name: string, module: T & Module, dependencies?: string[]): boolean;
4000
- t(key: string, space?: boolean): string;
4001
- auto(text: string): string;
4002
- disabled(modNames: string | string[], reload?: boolean): Promise<boolean>;
4003
- get lodash(): ReturnType<ModUtils['getLodash']>;
4004
- get marked(): typeof marked;
4005
- set SugarCube(parts: TwineSugarCube);
4006
- get SugarCube(): TwineSugarCube;
4007
- set Language(lang: string);
4008
- get Language(): string;
4009
- set LogLevel(level: string);
4010
- get LogLevel(): string;
4011
- get<K extends keyof (CoreModules & Extensions)>(name: K): (CoreModules & Extensions)[K] | undefined;
4012
- get(name: string): Module | undefined;
4013
- get dependencyGraph(): DependencyGraph;
4014
- get modLoader(): ReturnType<SC2DataManager['getModLoader']>;
4015
- get modUtils(): ModUtils;
4016
- get gameVersion(): string;
4017
- }
4018
- declare var maplebirch: Instance;
4019
- declare function createlog(prefix: string): (message: string, level?: string, ...objects: unknown[]) => void;
4020
- //#endregion
4021
- //#region src/services/CredentialVault.d.ts
4022
- type CredentialPeriod = 'day' | 'month';
4023
- interface AuthConfig {
4024
- key: string;
4025
- subject?: string;
4026
- name?: string;
4027
- publicKey: JsonWebKey | string;
4028
- prompt?: {
4029
- title?: string;
4030
- label?: string;
4031
- placeholder?: string;
4032
- hint?: string;
4033
- };
4034
- date?: {
4035
- period?: CredentialPeriod;
4036
- timezone?: string;
4037
- graceDays?: number;
4038
- };
4039
- }
4040
- interface AuthPayload {
4041
- subject: string;
4042
- key: string;
4043
- date?: string;
4044
- password: string;
4045
- expiresAt?: number;
4046
- }
4047
- interface CryptContext {
4048
- modName: string;
4049
- credential?: string;
4050
- payload?: AuthPayload;
4051
- }
4052
- interface CryptResult {
4053
- data: Awaited<InputFileFormat>;
4054
- auth?: AuthConfig | boolean | void;
4055
- }
4056
- interface CryptOptions {
4057
- modName?: string;
4058
- cache?: {
4059
- subject: string;
4060
- key: string;
4061
- };
4062
- password?: string;
4063
- prompt?: AuthConfig['prompt'] & {
4064
- name?: string;
4065
- };
4066
- lazyOptions?: unknown;
4067
- decrypt(password: string, context: CryptContext): Promise<CryptResult | Awaited<InputFileFormat>>;
4068
- }
4069
- declare class CredentialVault {
4070
- readonly core: MaplebirchCore;
4071
- private static readonly STORE;
4072
- private static readonly TOKEN_PREFIX;
4073
- private dialogQueue;
4074
- private storageKey;
4075
- constructor(core: MaplebirchCore);
4076
- loadCrypt(options: CryptOptions): Promise<boolean>;
4077
- private loadCredential;
4078
- private decryptAndLoad;
4079
- private decodeCredential;
4080
- private verify;
4081
- private credentialDate;
4082
- private readStored;
4083
- private storeStored;
4084
- private forget;
4085
- private ensurePromptStyle;
4086
- private promptCredential;
4087
- private ensureStorageKey;
4088
- private loadStorageKey;
4089
- private encryptRecord;
4090
- private decryptRecord;
4386
+ readonly combat: Combat;
4091
4387
  }
4092
- //#endregion
4093
- //#region src/utils/twine.d.ts
4094
- type Replacement = [RegExp, string];
4095
- declare function replace(content: string, replacements: Replacement[], label?: string): string;
4096
- //#endregion
4097
- //#region src/modules/Addon/Resources.d.ts
4098
- type ImageResult = string | false;
4099
- declare class Resources {
4100
- private readonly manager;
4101
- private readonly report;
4102
- private readonly cache;
4103
- private readonly pending;
4104
- constructor(manager: SC2DataManager, report: (path: string, error: unknown) => void);
4105
- normalize(path: string): string;
4106
- has(path: string): boolean | undefined;
4107
- load(path: string): ImageResult | Promise<ImageResult>;
4108
- clear(path?: string): void;
4109
- private resolve;
4388
+ declare global {
4389
+ interface MaplebirchExtensions extends CoreModules {}
4110
4390
  }
4111
4391
  //#endregion
4112
- //#region src/modules/AddonPlugin.d.ts
4113
- interface FileItem {
4114
- modName: string;
4115
- filePath: string;
4116
- content: string;
4117
- }
4118
- interface BootTask<T = unknown> {
4119
- modName: string;
4120
- modInfo: ModInfo;
4121
- modZip: ModZipReader;
4122
- config: T;
4123
- }
4124
- type BootHandler<T = unknown> = (task: BootTask<T>) => void | Promise<void>;
4125
- declare class AddonPlugin {
4126
- readonly core: MaplebirchCore;
4127
- onStart: boolean;
4128
- readonly replace: typeof replace;
4129
- readonly SC2DataManager: SC2DataManager;
4130
- readonly modUtils: ModUtils;
4131
- readonly resources: Resources;
4132
- readonly diagnostics: Diagnostics;
4133
- readonly info: Map<
4134
- string,
4135
- {
4136
- addonName: string;
4137
- mod: ModInfo;
4138
- modZip: ModZipReader;
4139
- }
4140
- >;
4141
- readonly log: ReturnType<typeof createlog>;
4142
- readonly jsFiles: FileItem[];
4143
- readonly moduleFiles: FileItem[];
4144
- private readonly disabledMods;
4145
- private readonly blockedPassages;
4146
- private readonly bootHooks;
4147
- private readonly bootQueue;
4148
- private onSaveLoadTracer;
4149
- private moduleFilesExecuted;
4150
- private scriptFilesExecuted;
4151
- private bootReady;
4152
- constructor(core: MaplebirchCore);
4153
- wikify(name: string, callbacks: WikifyTracerCallback): void;
4154
- hook<T>(name: string, handler: BootHandler<T>): boolean;
4155
- canLoadThisMod(bootJson: ModBootJson, _zip: JSZipLikeReadOnlyInterface): Promise<boolean>;
4156
- afterInjectEarlyLoad(): Promise<void>;
4157
- ModLoaderLoadEnd(): Promise<void>;
4158
- afterEarlyLoad(): Promise<void>;
4159
- registerMod(addonName: string, modInfo: ModInfo, modZip: ModZipReader): Promise<void>;
4160
- afterRegisterMod2Addon(): Promise<void>;
4161
- beforePatchModToGame(): Promise<void>;
4162
- PatchModToGame_start(): Promise<void>;
4163
- afterPatchModToGame(): Promise<void>;
4164
- afterPreload(): Promise<void>;
4165
- whenSC2StoryReady(): Promise<void>;
4166
- whenSC2PassageInit(passage: Passage): Promise<void>;
4167
- whenSC2PassageStart(passage: Passage, content: HTMLDivElement): Promise<void>;
4168
- whenSC2PassageRender(passage: Passage, content: HTMLDivElement): Promise<void>;
4169
- whenSC2PassageDisplay(passage: Passage, content: HTMLDivElement): Promise<void>;
4170
- whenSC2PassageEnd(passage: Passage, content: HTMLDivElement): Promise<void>;
4171
- loadCrypt(options: CryptOptions): Promise<boolean>;
4172
- private scriptFiles;
4173
- private dataReplace;
4174
- private loadFiles;
4175
- private executeScripts;
4176
- private process;
4177
- private queue;
4178
- private flush;
4179
- private run;
4180
- private config;
4181
- private modifyOptionsDateFormat;
4392
+ //#region src/modules/Frameworks/ImageLoader.d.ts
4393
+ declare class ImageLoader {
4394
+ private static refreshTimer;
4395
+ static load(src: string): string | false | Promise<string | false>;
4396
+ private static queueRefresh;
4182
4397
  }
4183
4398
  //#endregion
4184
- export { type CoreEvents, type CoreModules, type Extensions, type MaplebirchCore, type Save, type SaveObject, maplebirch as default, index_d_exports as utils };
4399
+ export {
4400
+ type AddonServices,
4401
+ type BootHandler,
4402
+ type BootTask,
4403
+ type CloudSaveConfig,
4404
+ type CloudSaveRecord,
4405
+ type CloudSaveRemoteCode,
4406
+ type CloudSaveRemoteItem,
4407
+ type CoreEvents,
4408
+ type CoreModules,
4409
+ type DependencyGraph,
4410
+ type DependencyInfo,
4411
+ type DiagnosticRecord,
4412
+ DoLDynamic,
4413
+ type DoLGlobalScope,
4414
+ type DoLHost,
4415
+ DoLToolCollection,
4416
+ Dynamic,
4417
+ type EventCallback,
4418
+ type Extensions,
4419
+ type FrameworkHost,
4420
+ type FrameworkInfra,
4421
+ type FrameworkServices,
4422
+ type HookCallback,
4423
+ ImageLoader,
4424
+ type LifecyclePhase,
4425
+ type LifecycleResult,
4426
+ type LifecycleTarget,
4427
+ type LogLevel,
4428
+ type MaplebirchCore,
4429
+ type ModConflict,
4430
+ type Module,
4431
+ type ModulesMeta,
4432
+ type PatchResult,
4433
+ Resources,
4434
+ type SaveObject,
4435
+ type StateEventOptions,
4436
+ ToolCollection,
4437
+ type Translation,
4438
+ maplebirch as default,
4439
+ dol,
4440
+ index_d_exports as utils
4441
+ };