@scml-dol-maplebirch/types 5.0.0 → 5.0.2
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 +25 -32
- package/package.json +1 -1
package/maplebirch.d.ts
CHANGED
|
@@ -23,7 +23,6 @@ import { VisibilityAPI } from '@scml/sc2-verlnir/src/visibility';
|
|
|
23
23
|
import { WikifierAPI } from '@scml/sc2-verlnir/src/wikifier';
|
|
24
24
|
import { SugarCubeStoryVariables, SugarCubeTemporaryVariables } from 'twine-sugarcube/userdata';
|
|
25
25
|
import { SC2DataManager } from '@scml/types/sugarcube-2-ModLoader/SC2DataManager';
|
|
26
|
-
import { WikifyTracerCallback } from '@scml/types/sugarcube-2-ModLoader/WikifyTracer';
|
|
27
26
|
import { Gui } from '@scml/types/Mod_LoaderGui/Gui';
|
|
28
27
|
import * as marked from 'marked';
|
|
29
28
|
import jsyaml from 'js-yaml';
|
|
@@ -897,13 +896,6 @@ interface PatchResult {
|
|
|
897
896
|
expected?: number;
|
|
898
897
|
error?: string;
|
|
899
898
|
}
|
|
900
|
-
interface ModRequirement {
|
|
901
|
-
name: string;
|
|
902
|
-
range?: string;
|
|
903
|
-
version?: string;
|
|
904
|
-
status: 'available' | 'missing' | 'incompatible' | 'invalid';
|
|
905
|
-
error?: string;
|
|
906
|
-
}
|
|
907
899
|
interface ModConflict {
|
|
908
900
|
source: string;
|
|
909
901
|
dataSource: string;
|
|
@@ -927,11 +919,9 @@ export declare class Diagnostics extends Logger {
|
|
|
927
919
|
get patches(): PatchResult[];
|
|
928
920
|
recordPatch(result: PatchResult): void;
|
|
929
921
|
clearPatches(): void;
|
|
930
|
-
mod(name: string, range?: string): ModRequirement;
|
|
931
|
-
checkDependencies(): boolean;
|
|
932
922
|
get conflicts(): ModConflict[] | undefined;
|
|
933
923
|
export(): string;
|
|
934
|
-
|
|
924
|
+
reset(): void;
|
|
935
925
|
}
|
|
936
926
|
//#endregion
|
|
937
927
|
//#region src/host/Resources.d.ts
|
|
@@ -1703,6 +1693,8 @@ export declare class Catalog<Key, Value> extends Diagnostics {
|
|
|
1703
1693
|
get(key: Key): Value | undefined;
|
|
1704
1694
|
has(key: Key): boolean;
|
|
1705
1695
|
list(): Value[];
|
|
1696
|
+
clear(): void;
|
|
1697
|
+
get entries(): ReadonlyMap<Key, Value>;
|
|
1706
1698
|
}
|
|
1707
1699
|
//#endregion
|
|
1708
1700
|
//#region src/services/IndexedDB.d.ts
|
|
@@ -2010,8 +2002,10 @@ export declare class Lifecycle<Key = string, Target extends LifecycleTarget = Li
|
|
|
2010
2002
|
Init(): void;
|
|
2011
2003
|
loadInit(): void;
|
|
2012
2004
|
postInit(): void;
|
|
2013
|
-
execute(target: Target, phase:
|
|
2014
|
-
|
|
2005
|
+
execute(target: Target, phase: 'preInit', scope?: string): Promise<LifecycleResult>;
|
|
2006
|
+
execute(target: Target, phase: Exclude<LifecyclePhase, 'preInit'>, scope?: string): LifecycleResult;
|
|
2007
|
+
execute(target: Target, phase: LifecyclePhase, scope?: string): LifecycleResult | Promise<LifecycleResult>;
|
|
2008
|
+
private failure;
|
|
2015
2009
|
}
|
|
2016
2010
|
//#endregion
|
|
2017
2011
|
//#region src/services/Modules.d.ts
|
|
@@ -2137,12 +2131,15 @@ export declare class GUIControl {
|
|
|
2137
2131
|
//#endregion
|
|
2138
2132
|
//#region src/infra/Hooks.d.ts
|
|
2139
2133
|
type HookCallback<Args extends unknown[] = unknown[], Result = unknown> = (...args: Args) => Result | Promise<Result>;
|
|
2134
|
+
type HookErrorPolicy = 'throw' | 'continue';
|
|
2140
2135
|
export declare class Hooks<Args extends unknown[] = unknown[], Result = unknown> extends Catalog<string, HookCallback<Args, Result>> {
|
|
2136
|
+
private readonly onError;
|
|
2141
2137
|
private readonly order;
|
|
2142
|
-
constructor(modloader?: ModLoader);
|
|
2138
|
+
constructor(modloader?: ModLoader, onError?: HookErrorPolicy);
|
|
2143
2139
|
add(name: string, callback: HookCallback<Args, Result>, order?: number): boolean;
|
|
2144
2140
|
remove(name: string): boolean;
|
|
2145
|
-
|
|
2141
|
+
clear(): void;
|
|
2142
|
+
execute(...args: Args): Result[];
|
|
2146
2143
|
call(name: string, ...args: Args): Promise<Awaited<Result> | undefined>;
|
|
2147
2144
|
}
|
|
2148
2145
|
//#endregion
|
|
@@ -2195,7 +2192,6 @@ export declare class AddonPlugin extends Hooks<[BootTask], void> {
|
|
|
2195
2192
|
constructor(modloader: ModLoader, sugarcube: SugarCube, events: Emitter, idb: IndexedDB, modules: Modules, services: AddonServices);
|
|
2196
2193
|
get SC2DataManager(): SC2DataManager;
|
|
2197
2194
|
get modUtils(): ModUtils;
|
|
2198
|
-
wikify(name: string, callbacks: WikifyTracerCallback): void;
|
|
2199
2195
|
hook<T>(name: string, handler: BootHandler<T>): boolean;
|
|
2200
2196
|
canLoadThisMod(bootJson: ModBootJson, _zip: JSZipLikeReadOnlyInterface): Promise<boolean>;
|
|
2201
2197
|
afterInjectEarlyLoad(): Promise<void>;
|
|
@@ -2318,6 +2314,7 @@ declare const MaplebirchCore: {
|
|
|
2318
2314
|
get LogLevel(): string;
|
|
2319
2315
|
set LogLevel(level: string);
|
|
2320
2316
|
get dependencyGraph(): DependencyGraph;
|
|
2317
|
+
get modList(): string[];
|
|
2321
2318
|
on<Name extends keyof CoreEvents>(eventName: Name, callback: EventCallback<CoreEvents[Name]>, description?: string): boolean;
|
|
2322
2319
|
on<Name extends string, Args extends unknown[]>(eventName: Name extends keyof CoreEvents ? never : Name, callback: EventCallback<Args>, description?: string): boolean;
|
|
2323
2320
|
off<Args extends unknown[]>(eventName: string, identifier: string | EventCallback<Args>): boolean;
|
|
@@ -2328,7 +2325,6 @@ declare const MaplebirchCore: {
|
|
|
2328
2325
|
trigger<Name extends keyof CoreEvents>(eventName: Name, ...args: CoreEvents[Name]): Promise<void>;
|
|
2329
2326
|
trigger<Name extends string>(eventName: Name extends keyof CoreEvents ? never : Name, ...args: unknown[]): Promise<void>;
|
|
2330
2327
|
define<T extends object>(name: string, module: T & Module, dependencies?: string[]): boolean;
|
|
2331
|
-
wikify(name: string, callbacks: WikifyTracerCallback): void;
|
|
2332
2328
|
idb(name: string, options?: IDBObjectStoreParameters, indexes?: StoreIndex[]): boolean;
|
|
2333
2329
|
with<T, Mode extends IDBTransactionMode>(storeNames: string | string[], mode: Mode, callback: (tx: Transaction<Mode>) => T | Promise<T>): Promise<T>;
|
|
2334
2330
|
t(key: string, space?: boolean): string;
|
|
@@ -2568,9 +2564,12 @@ declare class defineMacros {
|
|
|
2568
2564
|
readonly log: ScopedLog;
|
|
2569
2565
|
readonly macros: string[];
|
|
2570
2566
|
readonly statFunctions: Record<string, StatFunction>;
|
|
2567
|
+
private readonly definitions;
|
|
2571
2568
|
constructor(manager: ToolCollection);
|
|
2572
2569
|
get Macro(): ReturnType<MaplebirchCore['host']['sugarcube']['require']>['Macro'];
|
|
2573
2570
|
define<Args extends unknown[]>(macroName: string, macroFunction: MacroFunction<Args>, tags?: MacroTags, skipArgs?: SkipArgs, isAsync?: boolean): void;
|
|
2571
|
+
private installAll;
|
|
2572
|
+
private install;
|
|
2574
2573
|
defineS<Args extends unknown[]>(macroName: string, macroFunction: SimpleMacroFunction<Args>, tags?: MacroTags, skipArgs?: SkipArgs, maintainContext?: boolean): void;
|
|
2575
2574
|
create<Args extends unknown[]>(name: string, fn: StatFunction<Args>): void;
|
|
2576
2575
|
callStatFunction(name: string, ...args: unknown[]): DocumentFragment;
|
|
@@ -2731,22 +2730,16 @@ declare const applyLinkZone: typeof LinkZoneManager;
|
|
|
2731
2730
|
//#endregion
|
|
2732
2731
|
//#region src/modules/Frameworks/Patch.d.ts
|
|
2733
2732
|
type PatchPhase = 'init' | 'state';
|
|
2734
|
-
interface WidgetPatch {
|
|
2735
|
-
before?: (text: string) => string;
|
|
2736
|
-
after?: (node: DocumentFragment) => void;
|
|
2737
|
-
}
|
|
2738
2733
|
interface PatchDefinition<T extends object = object, Flat extends object = T> {
|
|
2739
2734
|
api: T;
|
|
2740
2735
|
legacy?: Flat;
|
|
2741
2736
|
available?: () => boolean;
|
|
2742
2737
|
init?: () => void;
|
|
2743
2738
|
state?: () => void;
|
|
2744
|
-
widgets?: Readonly<Record<string, WidgetPatch>>;
|
|
2745
2739
|
}
|
|
2746
2740
|
declare class Patch<Extensions extends Record<string, object> = Record<never, never>> {
|
|
2747
2741
|
private readonly report;
|
|
2748
|
-
private readonly
|
|
2749
|
-
private readonly extensionValues;
|
|
2742
|
+
private readonly definitions;
|
|
2750
2743
|
constructor(report: (name: string, error: unknown) => void);
|
|
2751
2744
|
add<T extends object, Flat extends object = T>(name: string, definition: PatchDefinition<T, Flat>): this & Flat;
|
|
2752
2745
|
get<Name extends keyof Extensions>(name: Name): Extensions[Name] | undefined;
|
|
@@ -2755,9 +2748,6 @@ declare class Patch<Extensions extends Record<string, object> = Record<never, ne
|
|
|
2755
2748
|
require<T extends object = object>(name: string): T;
|
|
2756
2749
|
has(name: string): boolean;
|
|
2757
2750
|
names(): string[];
|
|
2758
|
-
beforeWidget(widget: string, text: string): string;
|
|
2759
|
-
afterWidget(widget: string, node: DocumentFragment): void;
|
|
2760
|
-
private widget;
|
|
2761
2751
|
private available;
|
|
2762
2752
|
private run;
|
|
2763
2753
|
apply(phase: PatchPhase): void;
|
|
@@ -2781,6 +2771,8 @@ declare class ToolCollection {
|
|
|
2781
2771
|
readonly patch: Patch;
|
|
2782
2772
|
constructor(core: MaplebirchCore, constructors?: ToolConstructors);
|
|
2783
2773
|
onInit(...widgets: InitFunction[]): void;
|
|
2774
|
+
define<Args extends unknown[]>(name: string, fn: MacroFunction<Args>, tags?: MacroTags, skipArgs?: SkipArgs, isAsync?: boolean): void;
|
|
2775
|
+
defineS<Args extends unknown[]>(name: string, fn: SimpleMacroFunction<Args>, tags?: MacroTags, skipArgs?: SkipArgs, maintainContext?: boolean): void;
|
|
2784
2776
|
addTo(zone: string, ...widgets: ZoneWidget[]): void;
|
|
2785
2777
|
inject(...databases: Parameters<zonesManager['inject']>): void;
|
|
2786
2778
|
}
|
|
@@ -2911,9 +2903,8 @@ declare class TimeEvent extends Event {
|
|
|
2911
2903
|
}
|
|
2912
2904
|
declare class TimeManager {
|
|
2913
2905
|
private readonly manager;
|
|
2914
|
-
private readonly eventTypes;
|
|
2915
2906
|
private readonly timeEvents;
|
|
2916
|
-
private readonly
|
|
2907
|
+
private readonly travelHooks;
|
|
2917
2908
|
readonly log: DoLDynamic['log'];
|
|
2918
2909
|
readonly TimeConstants: Readonly<{
|
|
2919
2910
|
secondsPerDay: 86400;
|
|
@@ -2949,6 +2940,7 @@ declare class TimeManager {
|
|
|
2949
2940
|
patchTime(TimeObject: typeof Time): void;
|
|
2950
2941
|
register(type: TimeEventType, eventId: string, options: TimeEventOptions): boolean;
|
|
2951
2942
|
unregister(type: string, eventId: string): boolean;
|
|
2943
|
+
onTravel(name: string, callback: (data: TimeData) => void): boolean;
|
|
2952
2944
|
timeTravel(options?: TimeTravelOptions): boolean;
|
|
2953
2945
|
updateTimeLanguage(choice?: 'JournalTime'): string | boolean;
|
|
2954
2946
|
private handleTimePass;
|
|
@@ -2995,7 +2987,6 @@ declare class WeatherManager {
|
|
|
2995
2987
|
private readonly manager;
|
|
2996
2988
|
private readonly weatherEvents;
|
|
2997
2989
|
private readonly activeEvents;
|
|
2998
|
-
private sortedEventsCache;
|
|
2999
2990
|
private readonly Exceptions;
|
|
3000
2991
|
private readonly WeatherTypes;
|
|
3001
2992
|
private readonly layerModifications;
|
|
@@ -3003,6 +2994,7 @@ declare class WeatherManager {
|
|
|
3003
2994
|
private weatherTriggered;
|
|
3004
2995
|
private readonly log;
|
|
3005
2996
|
constructor(manager: DoLDynamic);
|
|
2997
|
+
private refresh;
|
|
3006
2998
|
private checkEvents;
|
|
3007
2999
|
register(eventId: string, options: WeatherEventOptions): boolean;
|
|
3008
3000
|
unregister(eventId: string): boolean;
|
|
@@ -3518,7 +3510,8 @@ declare class Character {
|
|
|
3518
3510
|
readonly log: ScopedLog;
|
|
3519
3511
|
readonly mask: typeof mask;
|
|
3520
3512
|
readonly faceStyleMap: Map<string, string[]>;
|
|
3521
|
-
private readonly
|
|
3513
|
+
private readonly processors;
|
|
3514
|
+
private nextProcessor;
|
|
3522
3515
|
private readonly layers;
|
|
3523
3516
|
readonly pet: Pet;
|
|
3524
3517
|
readonly transformation: Transformation;
|
|
@@ -4371,6 +4364,7 @@ declare class Combat {
|
|
|
4371
4364
|
readonly log: ScopedLog;
|
|
4372
4365
|
readonly CombatAction: CombatActions;
|
|
4373
4366
|
constructor(core: MaplebirchCore);
|
|
4367
|
+
preInit(): void;
|
|
4374
4368
|
private _generateCombatAction;
|
|
4375
4369
|
private _combatListColor;
|
|
4376
4370
|
private _combatButtonAdjustments;
|
|
@@ -4429,7 +4423,6 @@ export {
|
|
|
4429
4423
|
type LogLevel,
|
|
4430
4424
|
type MaplebirchCore,
|
|
4431
4425
|
type ModConflict,
|
|
4432
|
-
type ModRequirement,
|
|
4433
4426
|
type Module,
|
|
4434
4427
|
type ModulesMeta,
|
|
4435
4428
|
type PatchResult,
|