@scml-dol-maplebirch/types 4.3.5 → 4.4.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/index.d.ts +2 -2
- package/maplebirch.d.ts +1181 -372
- package/package.json +1 -1
package/maplebirch.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Passage } from '@scml/types/sugarcube-2-ModLoader/SugarCube2';
|
|
2
2
|
import { ModBootJson, ModInfo } from '@scml/types/sugarcube-2-ModLoader/ModLoader';
|
|
3
|
-
import { JSZipLikeReadOnlyInterface } from '@scml/types/sugarcube-2-ModLoader/JSZipLikeReadOnlyInterface';
|
|
3
|
+
import { InputFileFormat, JSZipLikeReadOnlyInterface } from '@scml/types/sugarcube-2-ModLoader/JSZipLikeReadOnlyInterface';
|
|
4
4
|
import { ModZipReader } from '@scml/types/sugarcube-2-ModLoader/ModZipReader';
|
|
5
5
|
import { SC2DataManager } from '@scml/types/sugarcube-2-ModLoader/SC2DataManager';
|
|
6
|
+
import { WikifyTracerCallback } from '@scml/types/sugarcube-2-ModLoader/WikifyTracer';
|
|
6
7
|
import { ModUtils } from '@scml/types/sugarcube-2-ModLoader/Utils';
|
|
7
8
|
import { BrowserAPI } from '@scml/sc2-verlnir/src/browser';
|
|
8
9
|
import { ConfigAPI } from '@scml/sc2-verlnir/src/config';
|
|
@@ -11,40 +12,269 @@ import { DialogAPI } from '@scml/sc2-verlnir/src/dialog';
|
|
|
11
12
|
import { EngineAPI } from '@scml/sc2-verlnir/src/engine';
|
|
12
13
|
import { FullscreenAPI } from '@scml/sc2-verlnir/src/fullscreen';
|
|
13
14
|
import { HasAPI } from '@scml/sc2-verlnir/src/has';
|
|
14
|
-
import { IdbAPI } from '@scml/sc2-verlnir/src/idb';
|
|
15
15
|
import { L10nAPI } from '@scml/sc2-verlnir/src/l10n';
|
|
16
|
-
import { LinksAPI } from '@scml/sc2-verlnir/src/links';
|
|
17
|
-
import { LoadScreenAPI } from '@scml/sc2-verlnir/src/loadscreen';
|
|
18
16
|
import { MacroAPI } from '@scml/sc2-verlnir/src/macro';
|
|
19
17
|
import { PassageConstructor } from '@scml/sc2-verlnir/src/passage';
|
|
20
18
|
import { SaveAPI } from '@scml/sc2-verlnir/src/save';
|
|
21
19
|
import { ScriptingAPI } from '@scml/sc2-verlnir/src/scripting';
|
|
22
20
|
import { SettingAPI } from '@scml/sc2-verlnir/src/setting';
|
|
23
21
|
import { SimpleAudioAPI } from '@scml/sc2-verlnir/src/simpleaudio';
|
|
24
|
-
import {
|
|
22
|
+
import { SimpleStoreInstanceAPI } from '@scml/sc2-verlnir/src/simplestore';
|
|
25
23
|
import { StoryAPI } from '@scml/sc2-verlnir/src/story';
|
|
26
|
-
import { TemplateAPI } from '@scml/sc2-verlnir/src/template';
|
|
27
24
|
import { UIAPI } from '@scml/sc2-verlnir/src/ui';
|
|
28
25
|
import { UIBarAPI } from '@scml/sc2-verlnir/src/uibar';
|
|
29
26
|
import { UtilAPI } from '@scml/sc2-verlnir/src/util';
|
|
30
27
|
import { VersionInfo } from '@scml/sc2-verlnir/src/version';
|
|
31
28
|
import { VisibilityAPI } from '@scml/sc2-verlnir/src/visibility';
|
|
32
29
|
import { WikifierAPI } from '@scml/sc2-verlnir/src/wikifier';
|
|
30
|
+
import { SugarCubeStoryVariables, SugarCubeTemporaryVariables } from 'twine-sugarcube/userdata';
|
|
33
31
|
import { Gui } from '@scml/types/Mod_LoaderGui/Gui';
|
|
34
32
|
import jsyaml from 'js-yaml';
|
|
35
33
|
import { Howl, Howler } from 'howler';
|
|
36
34
|
import * as marked from 'marked';
|
|
37
35
|
import { MacroContext } from 'twine-sugarcube';
|
|
38
36
|
//#endregion
|
|
37
|
+
//#region src/modules/Frameworks/Patches/Bodywriting.d.ts
|
|
38
|
+
interface BodywritingConfig {
|
|
39
|
+
writing?: string;
|
|
40
|
+
writ_cn?: string;
|
|
41
|
+
type?: 'text' | 'object';
|
|
42
|
+
arrow?: 0 | 1;
|
|
43
|
+
special?: string;
|
|
44
|
+
gender?: 'n' | 'f' | 'm' | 'h';
|
|
45
|
+
lewd?: 0 | 1;
|
|
46
|
+
degree?: number;
|
|
47
|
+
featSkip?: boolean;
|
|
48
|
+
sprites?: string[];
|
|
49
|
+
index?: number;
|
|
50
|
+
key?: string;
|
|
51
|
+
}
|
|
52
|
+
type BodywritingData =
|
|
53
|
+
| {
|
|
54
|
+
operation: 'add';
|
|
55
|
+
config: BodywritingConfig;
|
|
56
|
+
}
|
|
57
|
+
| {
|
|
58
|
+
operation: 'del';
|
|
59
|
+
};
|
|
60
|
+
type BodywritingItem = BodywritingConfig & {
|
|
61
|
+
index: number;
|
|
62
|
+
key: string;
|
|
63
|
+
};
|
|
64
|
+
declare class Bodywriting {
|
|
65
|
+
static add(key: string, config: BodywritingConfig): void;
|
|
66
|
+
static delete(key: string): void;
|
|
67
|
+
static apply(): void;
|
|
68
|
+
private static remove;
|
|
69
|
+
private static set;
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region src/modules/Frameworks/Patches/Foodstuff.d.ts
|
|
73
|
+
type FoodstuffSeason = 'spring' | 'summer' | 'autumn' | 'winter';
|
|
74
|
+
type FoodstuffPlantingBed = 'earth' | 'water';
|
|
75
|
+
type FoodstuffStallSize = 'small' | 'large';
|
|
76
|
+
interface FoodstuffConfig {
|
|
77
|
+
key?: string;
|
|
78
|
+
index?: number;
|
|
79
|
+
is_fishing_bait?: boolean;
|
|
80
|
+
name?: string;
|
|
81
|
+
singular?: string;
|
|
82
|
+
plural?: string;
|
|
83
|
+
icon?: string;
|
|
84
|
+
category?: string;
|
|
85
|
+
kitchen_item_type_icon?: string;
|
|
86
|
+
prop_folder?: string;
|
|
87
|
+
ingredient_alternatives?: Partial<Record<'normal' | 'lewd', string[]>>;
|
|
88
|
+
tending?: {
|
|
89
|
+
planting_bed?: FoodstuffPlantingBed;
|
|
90
|
+
growth_days?: number;
|
|
91
|
+
featCost?: number;
|
|
92
|
+
yield_multiplier?: number;
|
|
93
|
+
has_seeds?: boolean;
|
|
94
|
+
seed_name?: string;
|
|
95
|
+
seasons?: FoodstuffSeason[];
|
|
96
|
+
affected_by_tending_skill?: boolean;
|
|
97
|
+
tags?: string[];
|
|
98
|
+
[key: string]: unknown;
|
|
99
|
+
};
|
|
100
|
+
shop?: {
|
|
101
|
+
sell_price?: number;
|
|
102
|
+
available_in?: string[];
|
|
103
|
+
bought_in_bulk?: number;
|
|
104
|
+
stall_size?: FoodstuffStallSize;
|
|
105
|
+
[key: string]: unknown;
|
|
106
|
+
};
|
|
107
|
+
recipe?: {
|
|
108
|
+
recipe_name?: string;
|
|
109
|
+
difficulty?: number;
|
|
110
|
+
cook_minutes?: number;
|
|
111
|
+
servings?: number;
|
|
112
|
+
ingredients?: string[];
|
|
113
|
+
ingredient_alternatives?: Partial<Record<'normal' | 'lewd', Record<string, string[]>>>;
|
|
114
|
+
tags?: string[];
|
|
115
|
+
[key: string]: unknown;
|
|
116
|
+
};
|
|
117
|
+
food?: {
|
|
118
|
+
handheld_gift?: boolean;
|
|
119
|
+
tags?: string[];
|
|
120
|
+
[key: string]: unknown;
|
|
121
|
+
};
|
|
122
|
+
[key: string]: unknown;
|
|
123
|
+
}
|
|
124
|
+
type FoodstuffItem = FoodstuffConfig & Required<Pick<FoodstuffConfig, 'index' | 'name' | 'singular' | 'plural' | 'icon' | 'category' | 'kitchen_item_type_icon' | 'prop_folder'>>;
|
|
125
|
+
declare class Foodstuff {
|
|
126
|
+
static add(key: string, config: FoodstuffConfig): void;
|
|
127
|
+
static apply(): void;
|
|
128
|
+
static syncState(): void;
|
|
129
|
+
static applySetup(): void;
|
|
130
|
+
private static set;
|
|
131
|
+
private static nextIndex;
|
|
132
|
+
private static sort;
|
|
133
|
+
private static ensureState;
|
|
134
|
+
}
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region src/modules/Frameworks/Patches/Location.d.ts
|
|
137
|
+
interface LocationConfigOptions {
|
|
138
|
+
overwrite?: boolean;
|
|
139
|
+
layer?: string;
|
|
140
|
+
element?: string;
|
|
141
|
+
}
|
|
142
|
+
interface LocationElement {
|
|
143
|
+
condition?: () => boolean;
|
|
144
|
+
image?: string;
|
|
145
|
+
frame?: number | (() => number);
|
|
146
|
+
animation?: {
|
|
147
|
+
frameDelay?: number;
|
|
148
|
+
cycleDelay?: number | (() => number);
|
|
149
|
+
};
|
|
150
|
+
[key: string]: unknown;
|
|
151
|
+
}
|
|
152
|
+
interface LocationConfig extends LocationElement {
|
|
153
|
+
folder?: string;
|
|
154
|
+
base?: Record<string, LocationElement> | LocationElement;
|
|
155
|
+
emissive?: Record<string, LocationElement> | LocationElement;
|
|
156
|
+
reflective?: Record<string, LocationElement> | LocationElement;
|
|
157
|
+
layerTop?: Record<string, LocationElement> | LocationElement;
|
|
158
|
+
weather?: Record<string, unknown>;
|
|
159
|
+
particles?: Record<string, unknown>[];
|
|
160
|
+
customMapping?: () => string;
|
|
161
|
+
}
|
|
162
|
+
interface LocationUpdate {
|
|
163
|
+
overwrite: boolean;
|
|
164
|
+
config: LocationConfig;
|
|
165
|
+
customMapping: (() => string) | null;
|
|
166
|
+
}
|
|
167
|
+
declare class Location {
|
|
168
|
+
static configure(locationId: string, config: LocationConfig, options?: LocationConfigOptions): boolean;
|
|
169
|
+
static apply(): void;
|
|
170
|
+
}
|
|
171
|
+
//#endregion
|
|
172
|
+
//#region src/modules/Frameworks/Patches/Fishing.d.ts
|
|
173
|
+
type FishingLocation = 'fishingBeach' | 'fishingPier' | 'fishingCoastPath' | 'fishingForestLake' | 'fishingMoor';
|
|
174
|
+
type FishingSeason = 'spring' | 'summer' | 'autumn' | 'winter';
|
|
175
|
+
type FishBehavior = 'runner' | 'darter' | 'panicked' | 'anchor' | 'thrasher' | 'slipper';
|
|
176
|
+
interface FishConfig {
|
|
177
|
+
minSize: number;
|
|
178
|
+
maxSize: number;
|
|
179
|
+
locations: Partial<Record<FishingLocation, number>>;
|
|
180
|
+
icon: string;
|
|
181
|
+
preferredSeason?: FishingSeason[];
|
|
182
|
+
preferredLocation?: FishingLocation[];
|
|
183
|
+
preferredBait?: string;
|
|
184
|
+
cookable?: boolean;
|
|
185
|
+
requiresBaitFish?: boolean;
|
|
186
|
+
isBaitFish?: boolean;
|
|
187
|
+
minigame?: {
|
|
188
|
+
behavior: FishBehavior;
|
|
189
|
+
maxStamina: number;
|
|
190
|
+
armFatigueDifficulty: number;
|
|
191
|
+
};
|
|
192
|
+
foodstuff?: FoodstuffConfig;
|
|
193
|
+
}
|
|
194
|
+
type FishData = Omit<FishConfig, 'foodstuff'> & Required<Pick<FishConfig, 'preferredSeason' | 'preferredLocation' | 'cookable'>>;
|
|
195
|
+
declare class Fishing {
|
|
196
|
+
static addFish(key: string, config: FishConfig): boolean;
|
|
197
|
+
static addBait(key: string, config: FoodstuffConfig): void;
|
|
198
|
+
static configureLocation(location: FishingLocation, weights: Record<string, number>): boolean;
|
|
199
|
+
static apply(): void;
|
|
200
|
+
}
|
|
201
|
+
//#endregion
|
|
202
|
+
//#region src/modules/Frameworks/Patches/Antiques.d.ts
|
|
203
|
+
interface AntiqueConfig {
|
|
204
|
+
hint: string;
|
|
205
|
+
museum: string;
|
|
206
|
+
name: string;
|
|
207
|
+
cn_name?: string;
|
|
208
|
+
journal: string;
|
|
209
|
+
journalName?: string;
|
|
210
|
+
icon: string;
|
|
211
|
+
key?: string;
|
|
212
|
+
}
|
|
213
|
+
declare class Antiques {
|
|
214
|
+
static add(key: string, config: AntiqueConfig): void;
|
|
215
|
+
static inject(data: Record<string, AntiqueConfig>): Record<string, AntiqueConfig>;
|
|
216
|
+
static syncState(): void;
|
|
217
|
+
}
|
|
218
|
+
//#endregion
|
|
219
|
+
//#region src/modules/Frameworks/Patches/Traits.d.ts
|
|
220
|
+
interface TraitCategory {
|
|
221
|
+
title: string;
|
|
222
|
+
traits: Trait[];
|
|
223
|
+
}
|
|
224
|
+
interface Trait {
|
|
225
|
+
name: string;
|
|
226
|
+
colour: string;
|
|
227
|
+
has: boolean;
|
|
228
|
+
text: string;
|
|
229
|
+
}
|
|
230
|
+
interface TraitConfig {
|
|
231
|
+
title: string;
|
|
232
|
+
name: string | (() => string);
|
|
233
|
+
colour: string | (() => string);
|
|
234
|
+
has: boolean | (() => boolean);
|
|
235
|
+
text: string | (() => string);
|
|
236
|
+
}
|
|
237
|
+
declare class Traits {
|
|
238
|
+
static add(...traits: Partial<TraitConfig>[]): void;
|
|
239
|
+
static inject(data: TraitCategory[], translate: (text: string) => string): TraitCategory[];
|
|
240
|
+
private static resolve;
|
|
241
|
+
}
|
|
242
|
+
//#endregion
|
|
39
243
|
//#region types/twine-sugarcube.d.ts
|
|
40
244
|
declare module 'twine-sugarcube/userdata' {
|
|
41
245
|
export interface SugarCubeSetupObject {
|
|
246
|
+
bodywriting: Record<string, BodywritingItem>;
|
|
247
|
+
bodywriting_namebyindex: (string | undefined)[];
|
|
248
|
+
foodstuff: Record<string, FoodstuffItem>;
|
|
249
|
+
LocationImages: Record<string, LocationConfig>;
|
|
250
|
+
Locations: Record<string, () => string>;
|
|
251
|
+
tips: Record<string, string[]>;
|
|
252
|
+
tipsList: string[];
|
|
253
|
+
fishing?: {
|
|
254
|
+
lootTables: {
|
|
255
|
+
fish: Record<string, FishData>;
|
|
256
|
+
};
|
|
257
|
+
};
|
|
42
258
|
[x: string]: any;
|
|
43
259
|
}
|
|
44
260
|
export interface SugarCubeStoryVariables {
|
|
261
|
+
foodstuff: Record<
|
|
262
|
+
string,
|
|
263
|
+
{
|
|
264
|
+
amount: number;
|
|
265
|
+
[key: string]: unknown;
|
|
266
|
+
}
|
|
267
|
+
>;
|
|
268
|
+
museumAntiques?: {
|
|
269
|
+
antiques: Record<string, string>;
|
|
270
|
+
maxCount: number;
|
|
271
|
+
[key: string]: unknown;
|
|
272
|
+
};
|
|
45
273
|
[x: string]: any;
|
|
46
274
|
}
|
|
47
275
|
export interface SugarCubeTemporaryVariables {
|
|
276
|
+
traitLists: TraitCategory[];
|
|
277
|
+
museumAntiqueText: Record<string, AntiqueConfig>;
|
|
48
278
|
[x: string]: any;
|
|
49
279
|
}
|
|
50
280
|
}
|
|
@@ -139,8 +369,8 @@ interface DolStateAPI {
|
|
|
139
369
|
play(...args: unknown[]): void;
|
|
140
370
|
}
|
|
141
371
|
interface DolSaveAPI extends SaveAPI {
|
|
142
|
-
serialize(metadata?:
|
|
143
|
-
deserialize(saveStr: string):
|
|
372
|
+
serialize(metadata?: unknown): string;
|
|
373
|
+
deserialize(saveStr: string): unknown;
|
|
144
374
|
}
|
|
145
375
|
type WikifierAPI$1 = WikifierAPI & {
|
|
146
376
|
wikifyEval(
|
|
@@ -151,9 +381,7 @@ type WikifierAPI$1 = WikifierAPI & {
|
|
|
151
381
|
passageTitle?: string
|
|
152
382
|
): DocumentFragment;
|
|
153
383
|
};
|
|
154
|
-
|
|
155
|
-
[key: string]: any;
|
|
156
|
-
}
|
|
384
|
+
type SugarCubeUtilAPI = UtilAPI;
|
|
157
385
|
interface TwineSugarCube {
|
|
158
386
|
Browser: BrowserAPI;
|
|
159
387
|
Config: ConfigAPI;
|
|
@@ -162,25 +390,20 @@ interface TwineSugarCube {
|
|
|
162
390
|
Fullscreen: FullscreenAPI;
|
|
163
391
|
Has: HasAPI;
|
|
164
392
|
L10n: L10nAPI;
|
|
165
|
-
Links: LinksAPI;
|
|
166
|
-
LoadScreen: LoadScreenAPI;
|
|
167
393
|
Macro: MacroAPI;
|
|
168
394
|
Passage: PassageConstructor;
|
|
169
395
|
Save: DolSaveAPI;
|
|
170
396
|
Scripting: ScriptingAPI;
|
|
171
397
|
Setting: SettingAPI;
|
|
172
398
|
SimpleAudio: SimpleAudioAPI;
|
|
173
|
-
SimpleStore: SimpleStoreAPI;
|
|
174
399
|
State: DolStateAPI;
|
|
175
400
|
Story: StoryAPI;
|
|
176
|
-
Template: TemplateAPI;
|
|
177
401
|
UI: UIAPI;
|
|
178
402
|
UIBar: UIBarAPI;
|
|
179
403
|
DebugBar: DebugBarAPI;
|
|
180
404
|
Util: SugarCubeUtilAPI;
|
|
181
405
|
Visibility: VisibilityAPI;
|
|
182
406
|
Wikifier: WikifierAPI$1;
|
|
183
|
-
idb: IdbAPI;
|
|
184
407
|
session: SimpleStoreInstanceAPI | null;
|
|
185
408
|
settings: Record<string, unknown>;
|
|
186
409
|
setup: Record<string, unknown>;
|
|
@@ -188,9 +411,9 @@ interface TwineSugarCube {
|
|
|
188
411
|
version: VersionInfo;
|
|
189
412
|
}
|
|
190
413
|
declare global {
|
|
191
|
-
const V:
|
|
414
|
+
const V: SugarCubeStoryVariables;
|
|
192
415
|
const C: Record<string, any>;
|
|
193
|
-
const T:
|
|
416
|
+
const T: SugarCubeTemporaryVariables;
|
|
194
417
|
interface DateTimeData {
|
|
195
418
|
year: number;
|
|
196
419
|
month: number;
|
|
@@ -336,6 +559,21 @@ declare global {
|
|
|
336
559
|
type CanvasLayerMap = Record<string, LayerConfig>;
|
|
337
560
|
type CanvasLayerFilter = string | Record<string, any>;
|
|
338
561
|
type CanvasLayerSrc = string | string[] | undefined;
|
|
562
|
+
type CanvasLayerMask =
|
|
563
|
+
| string
|
|
564
|
+
| {
|
|
565
|
+
path: string;
|
|
566
|
+
offsetX?: number;
|
|
567
|
+
offsetY?: number;
|
|
568
|
+
convert?: boolean;
|
|
569
|
+
};
|
|
570
|
+
type CanvasLayerMaskSrc = CanvasLayerMask | CanvasLayerMask[] | undefined;
|
|
571
|
+
interface CanvasLayerWorn {
|
|
572
|
+
slot: string;
|
|
573
|
+
integrity: string | number;
|
|
574
|
+
alt?: string;
|
|
575
|
+
index: number;
|
|
576
|
+
}
|
|
339
577
|
type CanvasLayerValueFn<T = any> = (options: any) => T;
|
|
340
578
|
interface CanvasModelOptionsData {
|
|
341
579
|
filters?: Record<string, any>;
|
|
@@ -358,14 +596,14 @@ declare global {
|
|
|
358
596
|
maskBlendMode?: string;
|
|
359
597
|
compositeOperation?: string;
|
|
360
598
|
desaturate?: boolean;
|
|
361
|
-
masksrc?:
|
|
599
|
+
masksrc?: CanvasLayerMaskSrc;
|
|
362
600
|
animation?: any;
|
|
363
601
|
filters?: CanvasLayerFilter[];
|
|
364
602
|
dx?: number;
|
|
365
603
|
dy?: number;
|
|
366
604
|
width?: number;
|
|
367
605
|
height?: number;
|
|
368
|
-
worn?:
|
|
606
|
+
worn?: CanvasLayerWorn;
|
|
369
607
|
scale?: boolean | number;
|
|
370
608
|
frameDx?: number;
|
|
371
609
|
frameDy?: number;
|
|
@@ -381,14 +619,14 @@ declare global {
|
|
|
381
619
|
maskBlendModefn?: CanvasLayerValueFn<string | undefined>;
|
|
382
620
|
compositeOperationfn?: CanvasLayerValueFn<string | undefined>;
|
|
383
621
|
desaturatefn?: CanvasLayerValueFn<boolean>;
|
|
384
|
-
masksrcfn?: CanvasLayerValueFn<
|
|
622
|
+
masksrcfn?: CanvasLayerValueFn<CanvasLayerMaskSrc>;
|
|
385
623
|
animationfn?: CanvasLayerValueFn<any>;
|
|
386
624
|
filtersfn?: CanvasLayerValueFn<CanvasLayerFilter[] | undefined>;
|
|
387
625
|
dxfn?: CanvasLayerValueFn<number>;
|
|
388
626
|
dyfn?: CanvasLayerValueFn<number>;
|
|
389
627
|
widthfn?: CanvasLayerValueFn<number>;
|
|
390
628
|
heightfn?: CanvasLayerValueFn<number>;
|
|
391
|
-
wornfn?: CanvasLayerValueFn<
|
|
629
|
+
wornfn?: CanvasLayerValueFn<CanvasLayerWorn | undefined>;
|
|
392
630
|
scalefn?: CanvasLayerValueFn<boolean | number | undefined>;
|
|
393
631
|
[key: string]: any;
|
|
394
632
|
}
|
|
@@ -447,17 +685,46 @@ declare global {
|
|
|
447
685
|
//#region src/constants.d.ts
|
|
448
686
|
type LanguageCode = (typeof Languages)[number];
|
|
449
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
|
+
}
|
|
450
695
|
//#endregion
|
|
451
696
|
//#region src/utils/object.d.ts
|
|
452
|
-
type
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
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'>;
|
|
461
728
|
//#endregion
|
|
462
729
|
//#region src/utils/array.d.ts
|
|
463
730
|
type ContainsMode = 'all' | 'any' | 'none';
|
|
@@ -469,7 +736,7 @@ type ContainsOptions = {
|
|
|
469
736
|
declare function contains(array: readonly unknown[], value: unknown, mode?: ContainsMode, options?: ContainsOptions): boolean;
|
|
470
737
|
declare function randomNumber(min?: number, max?: number, float?: boolean): number;
|
|
471
738
|
declare function randomPick<T>(items: readonly T[], weights?: readonly number[] | null, allowNull?: boolean): T | null | undefined;
|
|
472
|
-
declare function clamp(value:
|
|
739
|
+
declare function clamp(value: unknown, min: number, max: number, fallback?: number): number;
|
|
473
740
|
//#endregion
|
|
474
741
|
//#region src/utils/string.d.ts
|
|
475
742
|
type ConvertMode$1 = 'lower' | 'upper' | 'capitalize' | 'title' | 'camel' | 'pascal' | 'snake' | 'kebab' | 'constant';
|
|
@@ -488,7 +755,7 @@ declare function widgets(...contents: string[]): string[];
|
|
|
488
755
|
//#region src/utils/binary.d.ts
|
|
489
756
|
declare function textToBytes(value: string): Uint8Array;
|
|
490
757
|
declare function jsonToBytes(value: unknown): Uint8Array;
|
|
491
|
-
declare function bytesToJson<T =
|
|
758
|
+
declare function bytesToJson<T = unknown>(bytes: Uint8Array | ArrayBuffer): T;
|
|
492
759
|
declare function toArrayBuffer(bytes: Uint8Array): ArrayBuffer;
|
|
493
760
|
declare function bytesToBase64(bytes: Uint8Array): string;
|
|
494
761
|
declare function base64ToBytes(value: string): Uint8Array;
|
|
@@ -498,46 +765,51 @@ declare function basicAuth(username: string, password: string): string;
|
|
|
498
765
|
//#region src/utils/path.d.ts
|
|
499
766
|
declare function joinEncodedPath(...parts: string[]): string;
|
|
500
767
|
//#endregion
|
|
768
|
+
//#region src/utils/error.d.ts
|
|
769
|
+
declare function errorMessage(error: unknown): string;
|
|
770
|
+
//#endregion
|
|
501
771
|
//#region src/utils/selector.d.ts
|
|
502
|
-
|
|
503
|
-
|
|
772
|
+
type Comparator = '<' | '<=' | '>' | '>=';
|
|
773
|
+
type ResultValue<Input, Result, Meta> = Result | ((input: Input, meta: Meta) => Result);
|
|
774
|
+
declare class SelectCase<Input = unknown, Result = unknown, Meta = Record<string, unknown>> {
|
|
775
|
+
private readonly cases;
|
|
504
776
|
private defaultResult;
|
|
505
777
|
private valueType;
|
|
506
778
|
private allowMixedTypes;
|
|
507
|
-
case(condition: string | number, result:
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
779
|
+
case(condition: string | number | ((input: Input, meta: Meta) => boolean), result: ResultValue<Input, Result, Meta>): this;
|
|
780
|
+
casePredicate(fn: (input: Input, meta: Meta) => boolean, result: ResultValue<Input, Result, Meta>): this;
|
|
781
|
+
caseRange(min: number, max: number, result: ResultValue<Input, Result, Meta>): this;
|
|
782
|
+
caseIn(values: readonly (string | number)[], result: ResultValue<Input, Result, Meta>): this;
|
|
783
|
+
caseIncludes(values: string | readonly string[], result: ResultValue<Input, Result, Meta>): this;
|
|
784
|
+
caseRegex(regex: RegExp, result: ResultValue<Input, Result, Meta>): this;
|
|
785
|
+
caseCompare(operator: Comparator, value: number, result: ResultValue<Input, Result, Meta>): this;
|
|
786
|
+
else(result: ResultValue<Input, Result, Meta>): this;
|
|
787
|
+
match(input: Input, meta?: Meta): Result | null;
|
|
788
|
+
private resolve;
|
|
517
789
|
private validateType;
|
|
518
790
|
}
|
|
519
791
|
//#endregion
|
|
520
792
|
//#region src/utils/image.d.ts
|
|
521
|
-
declare function loadImage(src: string): string |
|
|
793
|
+
declare function loadImage(src: string): string | false | Promise<string | false>;
|
|
522
794
|
//#endregion
|
|
523
795
|
//#region src/utils/prototype.d.ts
|
|
524
796
|
declare global {
|
|
525
797
|
interface ObjectConstructor {
|
|
526
|
-
merge<T extends object =
|
|
527
|
-
append<T extends object =
|
|
528
|
-
cover<T extends object =
|
|
529
|
-
mergefn<T extends object =
|
|
530
|
-
appendfn<T extends object =
|
|
531
|
-
coverfn<T extends object =
|
|
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;
|
|
532
804
|
}
|
|
533
805
|
interface Array<T> {
|
|
534
806
|
contains(value: unknown, mode?: ContainsMode, options?: ContainsOptions): boolean;
|
|
535
807
|
either(weights?: number[], allowNull?: boolean): T | null | undefined;
|
|
536
808
|
}
|
|
537
809
|
interface ArrayConstructor {
|
|
538
|
-
merge<T
|
|
539
|
-
append<T
|
|
540
|
-
cover<T
|
|
810
|
+
merge<T>(...sources: readonly T[][]): T[];
|
|
811
|
+
append<T>(...sources: readonly T[][]): T[];
|
|
812
|
+
cover<T>(...sources: readonly T[][]): T[];
|
|
541
813
|
}
|
|
542
814
|
interface ReadonlyArray<T> {
|
|
543
815
|
contains(value: unknown, mode?: ContainsMode, options?: ContainsOptions): boolean;
|
|
@@ -562,7 +834,7 @@ declare global {
|
|
|
562
834
|
random(): number;
|
|
563
835
|
random(max: number): number;
|
|
564
836
|
random(min: number, max: number, float?: boolean): number;
|
|
565
|
-
clamp(value:
|
|
837
|
+
clamp(value: unknown, min: number, max: number, fallback?: number): number;
|
|
566
838
|
}
|
|
567
839
|
}
|
|
568
840
|
declare function prototypeUtils(): void;
|
|
@@ -584,6 +856,7 @@ declare namespace index_d_exports {
|
|
|
584
856
|
coverFn as coverfn,
|
|
585
857
|
randomPick as either,
|
|
586
858
|
equal,
|
|
859
|
+
errorMessage,
|
|
587
860
|
escapeHtmlText,
|
|
588
861
|
joinEncodedPath,
|
|
589
862
|
jsonToBytes,
|
|
@@ -630,21 +903,23 @@ declare class Logger {
|
|
|
630
903
|
}
|
|
631
904
|
//#endregion
|
|
632
905
|
//#region src/services/EventEmitter.d.ts
|
|
633
|
-
type EventCallback = (...args:
|
|
906
|
+
type EventCallback<Args extends unknown[] = unknown[]> = (...args: Args) => unknown;
|
|
634
907
|
declare class EventEmitter {
|
|
635
908
|
readonly core: MaplebirchCore;
|
|
636
909
|
private readonly events;
|
|
637
910
|
private readonly afters;
|
|
911
|
+
private readonly triggering;
|
|
638
912
|
private readonly stickyEvents;
|
|
639
913
|
private readonly stickyArgs;
|
|
914
|
+
private readonly synchronousEvents;
|
|
640
915
|
constructor(core: MaplebirchCore);
|
|
641
|
-
on(eventName: string, callback: EventCallback
|
|
642
|
-
off(eventName: string, identifier: EventCallback | string): boolean;
|
|
643
|
-
once(eventName: string, callback: EventCallback
|
|
644
|
-
trigger(eventName: string, ...args:
|
|
645
|
-
after(eventName: string, callback: EventCallback): void;
|
|
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;
|
|
646
922
|
private callSticky;
|
|
647
|
-
private error;
|
|
648
923
|
}
|
|
649
924
|
//#endregion
|
|
650
925
|
//#region node_modules/idb/build/entry.d.ts
|
|
@@ -1341,7 +1616,6 @@ declare class IndexedDBService {
|
|
|
1341
1616
|
withTransaction<T, Mode extends IDBTransactionMode>(storeNames: string | string[], mode: Mode, callback: (tx: Transaction<Mode>) => T | Promise<T>): Promise<T>;
|
|
1342
1617
|
clearStore(storeName: string): Promise<void>;
|
|
1343
1618
|
deleteDatabase(): Promise<boolean>;
|
|
1344
|
-
private error;
|
|
1345
1619
|
}
|
|
1346
1620
|
//#endregion
|
|
1347
1621
|
//#region src/services/CloudSaveService.d.ts
|
|
@@ -1350,11 +1624,12 @@ type PanelAction = 'connectRemote' | 'uploadSlot' | 'downloadSlot' | 'refreshRem
|
|
|
1350
1624
|
interface CloudSaveConfig {
|
|
1351
1625
|
endpoint: string;
|
|
1352
1626
|
token: string;
|
|
1627
|
+
remember?: boolean;
|
|
1353
1628
|
}
|
|
1354
1629
|
interface CloudSaveRecord {
|
|
1355
1630
|
slot: CloudSaveSlot;
|
|
1356
|
-
details:
|
|
1357
|
-
save:
|
|
1631
|
+
details: SaveDetails | null;
|
|
1632
|
+
save: SaveState;
|
|
1358
1633
|
exportedAt: number;
|
|
1359
1634
|
gameId?: string;
|
|
1360
1635
|
}
|
|
@@ -1372,10 +1647,28 @@ interface CloudSaveRemoteCode {
|
|
|
1372
1647
|
updatedAt: number;
|
|
1373
1648
|
payload?: CloudSaveCodeRecord;
|
|
1374
1649
|
}
|
|
1650
|
+
interface SaveDetails {
|
|
1651
|
+
date?: number;
|
|
1652
|
+
title?: string;
|
|
1653
|
+
idx?: unknown;
|
|
1654
|
+
metadata?: {
|
|
1655
|
+
saveName?: string;
|
|
1656
|
+
[key: string]: unknown;
|
|
1657
|
+
};
|
|
1658
|
+
[key: string]: unknown;
|
|
1659
|
+
}
|
|
1660
|
+
interface SaveState {
|
|
1661
|
+
history?: DolStateMoment[];
|
|
1662
|
+
delta?: unknown;
|
|
1663
|
+
[key: string]: unknown;
|
|
1664
|
+
}
|
|
1375
1665
|
declare class CloudSaveService {
|
|
1376
1666
|
readonly core: MaplebirchCore;
|
|
1377
1667
|
private static readonly PANEL_STORAGE_KEY;
|
|
1668
|
+
private static readonly REQUEST_TIMEOUT;
|
|
1378
1669
|
private config;
|
|
1670
|
+
private mountFrame;
|
|
1671
|
+
private busy;
|
|
1379
1672
|
constructor(core: MaplebirchCore);
|
|
1380
1673
|
configure(config: CloudSaveConfig): this;
|
|
1381
1674
|
/** 验证 Worker 与 Token 是否可用。 */
|
|
@@ -1408,6 +1701,7 @@ declare class CloudSaveService {
|
|
|
1408
1701
|
panelAction(action: PanelAction, slot?: CloudSaveSlot): Promise<void>;
|
|
1409
1702
|
private runPanelAction;
|
|
1410
1703
|
private done;
|
|
1704
|
+
private complete;
|
|
1411
1705
|
private refreshPanel;
|
|
1412
1706
|
private remoteRow;
|
|
1413
1707
|
private readPanel;
|
|
@@ -1417,11 +1711,18 @@ declare class CloudSaveService {
|
|
|
1417
1711
|
private request;
|
|
1418
1712
|
/** SugarCube delta 存档还原为完整 history。 */
|
|
1419
1713
|
private normalizeSave;
|
|
1714
|
+
private validateRecord;
|
|
1715
|
+
private validateCodeRecord;
|
|
1716
|
+
private isSlot;
|
|
1717
|
+
private validateSlot;
|
|
1718
|
+
private validateGame;
|
|
1719
|
+
private invalidResponse;
|
|
1420
1720
|
private field;
|
|
1421
1721
|
private setField;
|
|
1422
1722
|
private panelSlot;
|
|
1723
|
+
/** 动态填充本地存档槽位选项。 */
|
|
1724
|
+
populateSlotOptions(panel?: HTMLElement | null): Promise<void>;
|
|
1423
1725
|
private status;
|
|
1424
|
-
private error;
|
|
1425
1726
|
private get saveDB();
|
|
1426
1727
|
private get panel();
|
|
1427
1728
|
private get current();
|
|
@@ -1466,6 +1767,8 @@ declare class LanguageManager {
|
|
|
1466
1767
|
private writeBatch;
|
|
1467
1768
|
private removeOldTranslations;
|
|
1468
1769
|
private updateSource;
|
|
1770
|
+
private activeSources;
|
|
1771
|
+
private visibleTranslations;
|
|
1469
1772
|
private syncTranslation;
|
|
1470
1773
|
private readFileRecord;
|
|
1471
1774
|
private writeFileRecord;
|
|
@@ -1474,7 +1777,6 @@ declare class LanguageManager {
|
|
|
1474
1777
|
private computeHash;
|
|
1475
1778
|
private getModFile;
|
|
1476
1779
|
private rebuild;
|
|
1477
|
-
private error;
|
|
1478
1780
|
}
|
|
1479
1781
|
//#endregion
|
|
1480
1782
|
//#region src/services/ModuleSystem.d.ts
|
|
@@ -1485,11 +1787,10 @@ interface Module {
|
|
|
1485
1787
|
Init?(): void;
|
|
1486
1788
|
loadInit?(): void;
|
|
1487
1789
|
postInit?(): void;
|
|
1488
|
-
[key: string]: unknown;
|
|
1489
1790
|
}
|
|
1490
1791
|
interface ModuleRegistry {
|
|
1491
1792
|
modules: Map<string, Module>;
|
|
1492
|
-
states: Map<string,
|
|
1793
|
+
states: Map<string, ModuleState>;
|
|
1493
1794
|
sources: Map<string, string>;
|
|
1494
1795
|
dependencies: Map<string, Set<string>>;
|
|
1495
1796
|
dependents: Map<string, Set<string>>;
|
|
@@ -1524,7 +1825,7 @@ declare class ModuleSystem {
|
|
|
1524
1825
|
constructor(core: MaplebirchCore);
|
|
1525
1826
|
static traverse(roots: Iterable<string>, links: ReadonlyMap<string, Iterable<string>>, excluded?: ReadonlySet<string>): Set<string>;
|
|
1526
1827
|
with<T>(source: string, callback: () => T | Promise<T>): Promise<T>;
|
|
1527
|
-
register(name: string, module: Module, dependencies?: string[]): boolean;
|
|
1828
|
+
register<T extends object>(name: string, module: T & Module, dependencies?: string[]): boolean;
|
|
1528
1829
|
get(name: string): Module | undefined;
|
|
1529
1830
|
get dependencyGraph(): DependencyGraph;
|
|
1530
1831
|
run(phase: 'pre'): Promise<void>;
|
|
@@ -1543,7 +1844,6 @@ declare class ModuleSystem {
|
|
|
1543
1844
|
private circular;
|
|
1544
1845
|
private lifecycle;
|
|
1545
1846
|
private promiseLike;
|
|
1546
|
-
private error;
|
|
1547
1847
|
}
|
|
1548
1848
|
//#endregion
|
|
1549
1849
|
//#region src/services/GUIControl.d.ts
|
|
@@ -1584,31 +1884,49 @@ declare class GUIControl {
|
|
|
1584
1884
|
private whenCreate;
|
|
1585
1885
|
}
|
|
1586
1886
|
//#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;
|
|
1903
|
+
}
|
|
1904
|
+
//#endregion
|
|
1587
1905
|
//#region src/modules/TimeStateWeather/Event.d.ts
|
|
1588
1906
|
interface EventOptions {
|
|
1589
1907
|
priority?: number;
|
|
1590
1908
|
once?: boolean;
|
|
1591
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;
|
|
1918
|
+
}
|
|
1592
1919
|
//#endregion
|
|
1593
1920
|
//#region src/modules/TimeStateWeather/TimeEvents.d.ts
|
|
1594
1921
|
type TimeEventType = 'onSec' | 'onMin' | 'onHour' | 'onDay' | 'onWeek' | 'onMonth' | 'onYear' | 'onBefore' | 'onThread' | 'onAfter' | 'onTimeTravel';
|
|
1595
1922
|
type TimeUnit = 'sec' | 'min' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
|
1596
|
-
interface DateLike {
|
|
1597
|
-
hour: number;
|
|
1598
|
-
day: number;
|
|
1599
|
-
month: number;
|
|
1600
|
-
year: number;
|
|
1601
|
-
timeStamp: number;
|
|
1602
|
-
minute?: number;
|
|
1603
|
-
second?: number;
|
|
1604
|
-
}
|
|
1605
1923
|
interface AccumulateConfig {
|
|
1606
1924
|
unit: TimeUnit;
|
|
1607
1925
|
target?: number;
|
|
1608
1926
|
}
|
|
1609
1927
|
interface TimeData {
|
|
1610
|
-
prevDate?:
|
|
1611
|
-
currentDate?:
|
|
1928
|
+
prevDate?: DateTime;
|
|
1929
|
+
currentDate?: DateTime;
|
|
1612
1930
|
changes?: Record<TimeUnit, number>;
|
|
1613
1931
|
triggeredByAccumulator?: {
|
|
1614
1932
|
unit: TimeUnit;
|
|
@@ -1616,6 +1934,7 @@ interface TimeData {
|
|
|
1616
1934
|
count: number;
|
|
1617
1935
|
};
|
|
1618
1936
|
exactPoints?: {
|
|
1937
|
+
min: boolean;
|
|
1619
1938
|
hour: boolean;
|
|
1620
1939
|
day: boolean;
|
|
1621
1940
|
week: boolean;
|
|
@@ -1631,7 +1950,7 @@ interface TimeData {
|
|
|
1631
1950
|
month?: number;
|
|
1632
1951
|
year?: number;
|
|
1633
1952
|
weekday?: [number, number];
|
|
1634
|
-
detailedDiff?:
|
|
1953
|
+
detailedDiff?: ReturnType<DateTime['compareWith']>;
|
|
1635
1954
|
timeStamp?: number;
|
|
1636
1955
|
prev?: DateTime;
|
|
1637
1956
|
current?: DateTime;
|
|
@@ -1660,12 +1979,29 @@ interface TimeTravelOptions {
|
|
|
1660
1979
|
addMinutes?: number;
|
|
1661
1980
|
addSeconds?: number;
|
|
1662
1981
|
}
|
|
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;
|
|
1998
|
+
}
|
|
1663
1999
|
declare class TimeManager {
|
|
1664
2000
|
private readonly manager;
|
|
1665
2001
|
private readonly eventTypes;
|
|
1666
2002
|
private readonly timeEvents;
|
|
1667
2003
|
private readonly sortedEventsCache;
|
|
1668
|
-
readonly log:
|
|
2004
|
+
readonly log: DynamicManager['log'];
|
|
1669
2005
|
readonly TimeConstants: Readonly<{
|
|
1670
2006
|
secondsPerDay: 86400;
|
|
1671
2007
|
secondsPerHour: 3600;
|
|
@@ -1694,6 +2030,7 @@ declare class TimeManager {
|
|
|
1694
2030
|
}>;
|
|
1695
2031
|
}>;
|
|
1696
2032
|
constructor(manager: DynamicManager);
|
|
2033
|
+
get events(): Readonly<Record<string, ReadonlyMap<string, TimeEvent>>>;
|
|
1697
2034
|
init(): void;
|
|
1698
2035
|
patchDateTime(DateTimeClass: typeof DateTime): typeof DateTime;
|
|
1699
2036
|
patchTime(TimeObject: typeof Time): void;
|
|
@@ -1721,11 +2058,31 @@ interface StateEventOptions extends EventOptions {
|
|
|
1721
2058
|
match?: RegExp;
|
|
1722
2059
|
};
|
|
1723
2060
|
}
|
|
2061
|
+
interface StateEventResult {
|
|
2062
|
+
hasOutput: boolean;
|
|
2063
|
+
remove: boolean;
|
|
2064
|
+
}
|
|
2065
|
+
declare class StateEvent extends Event {
|
|
2066
|
+
readonly type: 'gate' | 'append';
|
|
2067
|
+
protected readonly eventName = 'StateEvent';
|
|
2068
|
+
output?: string;
|
|
2069
|
+
private action?;
|
|
2070
|
+
private cond;
|
|
2071
|
+
private forceExit;
|
|
2072
|
+
private extra;
|
|
2073
|
+
constructor(id: string, type: 'gate' | 'append', options?: StateEventOptions);
|
|
2074
|
+
private checkPassage;
|
|
2075
|
+
tryRun(passageName?: string): StateEventResult | null;
|
|
2076
|
+
private match;
|
|
2077
|
+
private runAction;
|
|
2078
|
+
shouldForceExit(): boolean;
|
|
2079
|
+
}
|
|
1724
2080
|
declare class StateManager {
|
|
1725
2081
|
private readonly manager;
|
|
1726
2082
|
private readonly stateEvents;
|
|
1727
2083
|
private readonly log;
|
|
1728
2084
|
constructor(manager: DynamicManager);
|
|
2085
|
+
get events(): Readonly<Record<'gate' | 'append', ReadonlyMap<string, StateEvent>>>;
|
|
1729
2086
|
trigger(type: 'gate' | 'append'): string;
|
|
1730
2087
|
private processGateEvents;
|
|
1731
2088
|
private processAppendEvents;
|
|
@@ -1800,11 +2157,11 @@ declare class DynamicManager {
|
|
|
1800
2157
|
regTimeEvent(type: TimeEventType, eventId: string, options: TimeEventOptions): boolean;
|
|
1801
2158
|
delTimeEvent(type: TimeEventType, eventId: string): boolean;
|
|
1802
2159
|
timeTravel(options?: TimeTravelOptions): boolean;
|
|
1803
|
-
get TimeEvents():
|
|
2160
|
+
get TimeEvents(): TimeManager['events'];
|
|
1804
2161
|
regStateEvent(type: 'gate' | 'append', eventId: string, options: StateEventOptions): boolean;
|
|
1805
2162
|
delStateEvent(type: 'gate' | 'append', eventId: string): boolean;
|
|
1806
2163
|
trigger(type: 'gate' | 'append'): string;
|
|
1807
|
-
get StateEvents():
|
|
2164
|
+
get StateEvents(): StateManager['events'];
|
|
1808
2165
|
regWeatherEvent(eventId: string, options: WeatherEventOptions): boolean;
|
|
1809
2166
|
delWeatherEvent(eventId: string): boolean;
|
|
1810
2167
|
addWeather(data: WeatherException | WeatherTypeConfig): boolean | void;
|
|
@@ -1876,30 +2233,30 @@ declare class CheatConsole {
|
|
|
1876
2233
|
interface Step {
|
|
1877
2234
|
from: string;
|
|
1878
2235
|
to: string;
|
|
1879
|
-
apply: (data: Record<string,
|
|
2236
|
+
apply: (data: Record<string, unknown>, utils: Utils) => void;
|
|
1880
2237
|
}
|
|
1881
2238
|
interface PathRef {
|
|
1882
|
-
parent: Record<string,
|
|
2239
|
+
parent: Record<string, unknown>;
|
|
1883
2240
|
key: string;
|
|
1884
2241
|
}
|
|
1885
2242
|
interface Utils {
|
|
1886
2243
|
readonly log: ReturnType<typeof createlog>;
|
|
1887
|
-
path: (obj: Record<string,
|
|
1888
|
-
move: (data: Record<string,
|
|
1889
|
-
remove: (data: Record<string,
|
|
1890
|
-
transform: (data: Record<string,
|
|
1891
|
-
fill: (target: Record<string,
|
|
2244
|
+
path: (obj: Record<string, unknown>, path: string, create?: boolean) => PathRef | null;
|
|
2245
|
+
move: (data: Record<string, unknown>, from: string, to: string) => boolean;
|
|
2246
|
+
remove: (data: Record<string, unknown>, path: string) => boolean;
|
|
2247
|
+
transform: (data: Record<string, unknown>, path: string, fn: (value: unknown) => unknown) => boolean;
|
|
2248
|
+
fill: (target: Record<string, unknown>, defaults: Record<string, unknown>, mode?: 'merge' | 'cover') => void;
|
|
1892
2249
|
}
|
|
1893
2250
|
declare class migration {
|
|
1894
|
-
static readonly log: (message: string, level?: string, ...objects:
|
|
2251
|
+
static readonly log: (message: string, level?: string, ...objects: unknown[]) => void;
|
|
1895
2252
|
static create(): migration;
|
|
1896
|
-
readonly log: (message: string, level?: string, ...objects:
|
|
2253
|
+
readonly log: (message: string, level?: string, ...objects: unknown[]) => void;
|
|
1897
2254
|
readonly utils: Utils;
|
|
1898
2255
|
steps: Step[];
|
|
1899
2256
|
private readonly unsafeKeys;
|
|
1900
2257
|
constructor();
|
|
1901
2258
|
add(from: string, to: string, apply: Step['apply']): void;
|
|
1902
|
-
run(data: Record<string,
|
|
2259
|
+
run(data: Record<string, unknown>, targetVersion: string): void;
|
|
1903
2260
|
private path;
|
|
1904
2261
|
private move;
|
|
1905
2262
|
private compare;
|
|
@@ -1912,9 +2269,9 @@ interface RandState {
|
|
|
1912
2269
|
index: number;
|
|
1913
2270
|
}
|
|
1914
2271
|
declare class randSystem {
|
|
1915
|
-
static readonly log: (message: string, level?: string, ...objects:
|
|
2272
|
+
static readonly log: (message: string, level?: string, ...objects: unknown[]) => void;
|
|
1916
2273
|
static create(state?: Partial<RandState>): randSystem;
|
|
1917
|
-
readonly log: (message: string, level?: string, ...objects:
|
|
2274
|
+
readonly log: (message: string, level?: string, ...objects: unknown[]) => void;
|
|
1918
2275
|
readonly state: RandState;
|
|
1919
2276
|
private readonly maxHistory;
|
|
1920
2277
|
private readonly modulus;
|
|
@@ -1935,16 +2292,23 @@ declare class randSystem {
|
|
|
1935
2292
|
//#region src/macros/helpers.d.ts
|
|
1936
2293
|
declare const CONVERT_MODES: readonly ['lower', 'upper', 'capitalize', 'title', 'camel', 'pascal', 'snake', 'kebab', 'constant'];
|
|
1937
2294
|
type ConvertMode = (typeof CONVERT_MODES)[number];
|
|
2295
|
+
type MacroArgs = unknown[] & {
|
|
2296
|
+
full?: string;
|
|
2297
|
+
raw?: string;
|
|
2298
|
+
};
|
|
1938
2299
|
interface MacroPayload {
|
|
1939
2300
|
name: string;
|
|
1940
|
-
args:
|
|
2301
|
+
args: MacroArgs;
|
|
1941
2302
|
contents?: string;
|
|
1942
2303
|
}
|
|
1943
|
-
interface MacroContext$1 extends Omit<MacroContext, 'createShadowWrapper' | 'error' | 'payload'> {
|
|
2304
|
+
interface MacroContext$1 extends Omit<MacroContext, 'args' | 'createShadowWrapper' | 'error' | 'payload'> {
|
|
2305
|
+
args: MacroArgs;
|
|
1944
2306
|
payload?: MacroPayload[] | null;
|
|
1945
|
-
error(msg: string):
|
|
1946
|
-
createShadowWrapper(callback:
|
|
1947
|
-
passageObj?:
|
|
2307
|
+
error(msg: string): void;
|
|
2308
|
+
createShadowWrapper(callback: (...args: never[]) => unknown, doneCallback?: (...args: never[]) => unknown, startCallback?: (...args: never[]) => unknown): (...args: unknown[]) => void;
|
|
2309
|
+
passageObj?: {
|
|
2310
|
+
title: string;
|
|
2311
|
+
};
|
|
1948
2312
|
lanListboxCache?: Record<
|
|
1949
2313
|
string,
|
|
1950
2314
|
{
|
|
@@ -1955,16 +2319,16 @@ interface MacroContext$1 extends Omit<MacroContext, 'createShadowWrapper' | 'err
|
|
|
1955
2319
|
}
|
|
1956
2320
|
interface ListboxOption {
|
|
1957
2321
|
label: string;
|
|
1958
|
-
value:
|
|
2322
|
+
value: unknown;
|
|
1959
2323
|
type: 'static' | 'dynamic';
|
|
1960
2324
|
exprIndex?: number;
|
|
1961
2325
|
convertMode: ConvertMode | null;
|
|
1962
2326
|
}
|
|
1963
2327
|
//#endregion
|
|
1964
2328
|
//#region src/modules/Frameworks/macros.d.ts
|
|
1965
|
-
type MacroFunction = (this: MacroContext$1, ...args:
|
|
1966
|
-
type SimpleMacroFunction = (this: MacroContext$1 | null, ...args:
|
|
1967
|
-
type StatFunction = (...args:
|
|
2329
|
+
type MacroFunction<Args extends unknown[] = unknown[]> = (this: MacroContext$1, ...args: Args) => unknown;
|
|
2330
|
+
type SimpleMacroFunction<Args extends unknown[]> = (this: MacroContext$1 | null, ...args: Args) => unknown;
|
|
2331
|
+
type StatFunction<Args extends unknown[] = unknown[]> = (...args: Args) => DocumentFragment;
|
|
1968
2332
|
type MacroTags = string[] | null | undefined;
|
|
1969
2333
|
type SkipArgs = string[] | boolean | null | undefined;
|
|
1970
2334
|
declare class defineMacros {
|
|
@@ -1974,23 +2338,32 @@ declare class defineMacros {
|
|
|
1974
2338
|
readonly statFunctions: Record<string, StatFunction>;
|
|
1975
2339
|
constructor(manager: ToolCollection);
|
|
1976
2340
|
get Macro(): MaplebirchCore['SugarCube']['Macro'];
|
|
1977
|
-
define(macroName: string, macroFunction: MacroFunction
|
|
1978
|
-
defineS(macroName: string, macroFunction: SimpleMacroFunction
|
|
2341
|
+
define<Args extends unknown[]>(macroName: string, macroFunction: MacroFunction<Args>, tags?: MacroTags, skipArgs?: SkipArgs, isAsync?: boolean): void;
|
|
2342
|
+
defineS<Args extends unknown[]>(macroName: string, macroFunction: SimpleMacroFunction<Args>, tags?: MacroTags, skipArgs?: SkipArgs, maintainContext?: boolean): void;
|
|
1979
2343
|
statChange(statType: string, amount: number, colorClass: string, condition?: () => boolean): DocumentFragment;
|
|
1980
2344
|
grace(amount: number, expectedRank?: string): DocumentFragment;
|
|
1981
|
-
create(name: string, fn: StatFunction): void;
|
|
1982
|
-
callStatFunction(name: string, ...args:
|
|
2345
|
+
create<Args extends unknown[]>(name: string, fn: StatFunction<Args>): void;
|
|
2346
|
+
callStatFunction(name: string, ...args: unknown[]): DocumentFragment;
|
|
1983
2347
|
}
|
|
1984
2348
|
//#endregion
|
|
1985
2349
|
//#region src/modules/Frameworks/HtmlTools.d.ts
|
|
2350
|
+
type HtmlRoot = Element | DocumentFragment;
|
|
2351
|
+
interface TextContext {
|
|
2352
|
+
readonly macro?: MacroContext$1;
|
|
2353
|
+
readonly args?: readonly unknown[];
|
|
2354
|
+
readonly name?: string;
|
|
2355
|
+
readonly widgetName?: string;
|
|
2356
|
+
readonly passageTitle?: string;
|
|
2357
|
+
readonly [key: string]: unknown;
|
|
2358
|
+
}
|
|
1986
2359
|
type TextContent = string | number | boolean | null | undefined;
|
|
1987
2360
|
type RawContent = TextContent | Node;
|
|
1988
2361
|
declare class Builder {
|
|
1989
2362
|
readonly parent: htmlTools;
|
|
1990
2363
|
readonly auto: (text: string) => string;
|
|
1991
|
-
readonly fragment:
|
|
1992
|
-
readonly context:
|
|
1993
|
-
constructor(parent: htmlTools, fragment:
|
|
2364
|
+
readonly fragment: HtmlRoot;
|
|
2365
|
+
readonly context: TextContext;
|
|
2366
|
+
constructor(parent: htmlTools, fragment: HtmlRoot, context?: TextContext);
|
|
1994
2367
|
text(content: TextContent, style?: string): this;
|
|
1995
2368
|
line(content?: TextContent, style?: string): this;
|
|
1996
2369
|
wikify(content: TextContent): this;
|
|
@@ -1998,22 +2371,75 @@ declare class Builder {
|
|
|
1998
2371
|
box(content: RawContent, style?: string): this;
|
|
1999
2372
|
}
|
|
2000
2373
|
declare class htmlTools {
|
|
2001
|
-
readonly core:
|
|
2374
|
+
readonly core: MaplebirchCore;
|
|
2002
2375
|
readonly log: ReturnType<typeof createlog>;
|
|
2003
2376
|
private uid;
|
|
2004
2377
|
private readonly store;
|
|
2005
|
-
constructor(
|
|
2006
|
-
get Wikifier():
|
|
2007
|
-
replaceText(oldText: string, newText: string):
|
|
2008
|
-
|
|
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;
|
|
2009
2384
|
add(key: string, handler: (tools: Builder) => void, id?: string): string | false;
|
|
2010
2385
|
delete(key: string, idOrHandler?: string | ((tools: Builder) => void)): boolean;
|
|
2011
2386
|
clear(): void;
|
|
2012
|
-
renderFragment(keys: string | string[], context?:
|
|
2013
|
-
|
|
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;
|
|
2014
2390
|
makeTextOutput(options?: { CSV?: boolean }): MacroFunction;
|
|
2015
2391
|
}
|
|
2016
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;
|
|
2441
|
+
}
|
|
2442
|
+
//#endregion
|
|
2017
2443
|
//#region src/modules/Frameworks/ZonesManager.d.ts
|
|
2018
2444
|
interface ZoneWidgetConfig {
|
|
2019
2445
|
exclude?: string[];
|
|
@@ -2021,48 +2447,54 @@ interface ZoneWidgetConfig {
|
|
|
2021
2447
|
passage?: string | string[];
|
|
2022
2448
|
widget: string;
|
|
2023
2449
|
type?: 'function';
|
|
2024
|
-
func?: () =>
|
|
2450
|
+
func?: () => unknown;
|
|
2025
2451
|
}
|
|
2026
2452
|
interface CustomLinkZoneItem {
|
|
2027
2453
|
position: number;
|
|
2028
2454
|
widget: string | ZoneWidgetConfig;
|
|
2029
2455
|
}
|
|
2030
|
-
|
|
2031
|
-
src?: string;
|
|
2032
|
-
srcmatch?: RegExp;
|
|
2033
|
-
srcmatchgroup?: RegExp;
|
|
2034
|
-
to?: string;
|
|
2035
|
-
applyafter?: string;
|
|
2036
|
-
applybefore?: string;
|
|
2037
|
-
}
|
|
2456
|
+
type PatchSet = SourcePatch;
|
|
2038
2457
|
type ZoneItem = string | ZoneWidgetConfig | CustomLinkZoneItem;
|
|
2458
|
+
type ZoneFunction = () => unknown;
|
|
2039
2459
|
type InitObject =
|
|
2040
2460
|
| {
|
|
2041
|
-
init:
|
|
2461
|
+
init: ZoneFunction;
|
|
2042
2462
|
}
|
|
2043
2463
|
| {
|
|
2044
2464
|
name: string;
|
|
2045
|
-
func:
|
|
2465
|
+
func: ZoneFunction;
|
|
2046
2466
|
};
|
|
2047
|
-
type
|
|
2467
|
+
type PositionedZoneWidgetConfig = Omit<ZoneWidgetConfig, 'widget'> & {
|
|
2468
|
+
widget: [number, string];
|
|
2469
|
+
};
|
|
2470
|
+
type ZoneWidget = string | ZoneFunction | ZoneWidgetConfig | PositionedZoneWidgetConfig | [number, string | ZoneWidgetConfig];
|
|
2471
|
+
interface CustomLinkGroup {
|
|
2472
|
+
position: number;
|
|
2473
|
+
macro: string;
|
|
2474
|
+
}
|
|
2475
|
+
type InitFunction = string | ZoneFunction | InitObject;
|
|
2048
2476
|
declare class zonesManager {
|
|
2049
2477
|
readonly log: ReturnType<typeof createlog>;
|
|
2050
2478
|
readonly core: ToolCollection['core'];
|
|
2051
2479
|
data: Record<string, ZoneItem[]>;
|
|
2052
2480
|
initFunction: InitFunction[];
|
|
2053
|
-
specialWidget: (string |
|
|
2054
|
-
defaultData: Record<string, string |
|
|
2481
|
+
specialWidget: (string | ZoneFunction)[];
|
|
2482
|
+
defaultData: Record<string, string | ZoneFunction>;
|
|
2055
2483
|
locationPassage: Record<string, PatchSet[]>;
|
|
2056
2484
|
widgetPassage: Record<string, PatchSet[]>;
|
|
2057
2485
|
widgethtml: string;
|
|
2058
|
-
private functions;
|
|
2486
|
+
private readonly functions;
|
|
2487
|
+
private readonly functionNames;
|
|
2488
|
+
private nextFunction;
|
|
2059
2489
|
constructor(manager: ToolCollection);
|
|
2060
2490
|
inject(...databases: Partial<Pick<zonesManager, 'specialWidget' | 'defaultData' | 'locationPassage' | 'widgetPassage'>>[]): void;
|
|
2061
2491
|
onInit(...widgets: InitFunction[]): void;
|
|
2062
|
-
addTo(zone: string, ...widgets:
|
|
2492
|
+
addTo(zone: string, ...widgets: ZoneWidget[]): void;
|
|
2063
2493
|
storyInit(): void;
|
|
2064
|
-
call(name: string):
|
|
2065
|
-
play(zone:
|
|
2494
|
+
call(name: string): unknown;
|
|
2495
|
+
play(zone: 'CustomLinkZone', passageTitle?: string): CustomLinkGroup[];
|
|
2496
|
+
play(zone: 'BeforeLinkZone' | 'AfterLinkZone', passageTitle?: string): string;
|
|
2497
|
+
play(zone: string, passageTitle?: string): string | CustomLinkGroup[];
|
|
2066
2498
|
patchModToGame(manager: AddonPlugin, type: 'before' | 'after'): void;
|
|
2067
2499
|
private get widgets();
|
|
2068
2500
|
private get specials();
|
|
@@ -2070,13 +2502,10 @@ declare class zonesManager {
|
|
|
2070
2502
|
private render;
|
|
2071
2503
|
private shouldRender;
|
|
2072
2504
|
private customLinkItem;
|
|
2073
|
-
private matchAndApply;
|
|
2074
|
-
private applyPatch;
|
|
2075
2505
|
private wrapSpecialPassage;
|
|
2076
2506
|
private applyContentPatches;
|
|
2077
2507
|
private patchPassage;
|
|
2078
2508
|
private widgetInit;
|
|
2079
|
-
private hash;
|
|
2080
2509
|
}
|
|
2081
2510
|
//#endregion
|
|
2082
2511
|
//#region src/modules/Frameworks/ApplyLinkZone.d.ts
|
|
@@ -2095,10 +2524,13 @@ interface LinkZoneConfig {
|
|
|
2095
2524
|
onAfterApply?: ((result: boolean, config: LinkZoneConfig) => void) | null;
|
|
2096
2525
|
debug: boolean;
|
|
2097
2526
|
}
|
|
2098
|
-
declare const log: (message: string, level?: string, ...objects:
|
|
2527
|
+
declare const log: (message: string, level?: string, ...objects: unknown[]) => void;
|
|
2099
2528
|
declare class LinkZoneManager {
|
|
2100
2529
|
readonly containerId: string;
|
|
2101
2530
|
readonly linkSelector: string;
|
|
2531
|
+
static readonly apply: (config?: Partial<LinkZoneConfig>) => boolean;
|
|
2532
|
+
static readonly add: (config: LinkZoneConfig, customZones: CustomZone[]) => void;
|
|
2533
|
+
static readonly defaultConfig: LinkZoneConfig;
|
|
2102
2534
|
firstLink: Element | null;
|
|
2103
2535
|
lastLink: Element | null;
|
|
2104
2536
|
links: Element[];
|
|
@@ -2118,159 +2550,165 @@ declare class LinkZoneManager {
|
|
|
2118
2550
|
}
|
|
2119
2551
|
declare const applyLinkZone: typeof LinkZoneManager;
|
|
2120
2552
|
//#endregion
|
|
2121
|
-
//#region src/modules/Frameworks/
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
customMapping?: any;
|
|
2154
|
-
[key: string]: any;
|
|
2155
|
-
}
|
|
2156
|
-
interface LocationUpdate {
|
|
2157
|
-
overwrite: boolean;
|
|
2158
|
-
config: LocationConfig;
|
|
2159
|
-
customMapping: any;
|
|
2553
|
+
//#region src/modules/Frameworks/Patches/Patch.d.ts
|
|
2554
|
+
type PatchPhase = 'init' | 'state';
|
|
2555
|
+
interface WidgetPatch {
|
|
2556
|
+
before?: (text: string) => string;
|
|
2557
|
+
after?: (node: DocumentFragment) => void;
|
|
2558
|
+
}
|
|
2559
|
+
interface PatchDefinition<T extends object = object, Flat extends object = T> {
|
|
2560
|
+
api: T;
|
|
2561
|
+
legacy?: Flat;
|
|
2562
|
+
available?: () => boolean;
|
|
2563
|
+
init?: () => void;
|
|
2564
|
+
state?: () => void;
|
|
2565
|
+
widgets?: Readonly<Record<string, WidgetPatch>>;
|
|
2566
|
+
}
|
|
2567
|
+
declare class Patch<Extensions extends Record<string, object> = Record<never, never>> {
|
|
2568
|
+
private readonly report;
|
|
2569
|
+
private readonly entries;
|
|
2570
|
+
private readonly extensionValues;
|
|
2571
|
+
constructor(report: (name: string, error: unknown) => void);
|
|
2572
|
+
add<T extends object, Flat extends object = T>(name: string, definition: PatchDefinition<T, Flat>): this & Flat;
|
|
2573
|
+
get<Name extends keyof Extensions>(name: Name): Extensions[Name] | undefined;
|
|
2574
|
+
get<T extends object = object>(name: string): T | undefined;
|
|
2575
|
+
require<Name extends keyof Extensions>(name: Name): Extensions[Name];
|
|
2576
|
+
require<T extends object = object>(name: string): T;
|
|
2577
|
+
has(name: string): boolean;
|
|
2578
|
+
names(): string[];
|
|
2579
|
+
beforeWidget(widget: string, text: string): string;
|
|
2580
|
+
afterWidget(widget: string, node: DocumentFragment): void;
|
|
2581
|
+
private widget;
|
|
2582
|
+
private available;
|
|
2583
|
+
private run;
|
|
2584
|
+
apply(phase: PatchPhase): void;
|
|
2160
2585
|
}
|
|
2161
2586
|
//#endregion
|
|
2162
|
-
//#region src/modules/Frameworks/
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
arrow?: 0 | 1;
|
|
2168
|
-
special?: string;
|
|
2169
|
-
gender?: 'n' | 'f' | 'm' | 'h';
|
|
2170
|
-
lewd?: 0 | 1;
|
|
2171
|
-
degree?: number;
|
|
2172
|
-
featSkip?: boolean;
|
|
2173
|
-
sprites?: string[];
|
|
2174
|
-
index?: number;
|
|
2175
|
-
key?: string;
|
|
2176
|
-
}
|
|
2177
|
-
interface BodywritingData {
|
|
2178
|
-
operation: 'add' | 'del';
|
|
2179
|
-
config?: BodywritingConfig;
|
|
2587
|
+
//#region src/modules/Frameworks/Patches/Tips.d.ts
|
|
2588
|
+
declare class Tips {
|
|
2589
|
+
static add(category: string, ...tips: string[]): void;
|
|
2590
|
+
static apply(): void;
|
|
2591
|
+
static inject(data: string[]): string[];
|
|
2180
2592
|
}
|
|
2181
2593
|
//#endregion
|
|
2182
|
-
//#region src/modules/Frameworks/
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
index?: number;
|
|
2189
|
-
name?: string;
|
|
2190
|
-
singular?: string;
|
|
2191
|
-
plural?: string;
|
|
2192
|
-
icon?: string;
|
|
2193
|
-
category?: string;
|
|
2194
|
-
kitchen_item_type_icon?: string;
|
|
2195
|
-
prop_folder?: string;
|
|
2196
|
-
ingredient_alternatives?: Record<string, string[]>;
|
|
2197
|
-
tending?: {
|
|
2198
|
-
planting_bed?: FoodstuffPlantingBed;
|
|
2199
|
-
growth_days?: number;
|
|
2200
|
-
yield_multiplier?: number;
|
|
2201
|
-
has_seeds?: boolean;
|
|
2202
|
-
seed_name?: string;
|
|
2203
|
-
seasons?: FoodstuffSeason[];
|
|
2204
|
-
affected_by_tending_skill?: boolean;
|
|
2205
|
-
tags?: string[];
|
|
2206
|
-
[key: string]: any;
|
|
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[];
|
|
2207
2600
|
};
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
stall_size?: FoodstuffStallSize;
|
|
2213
|
-
[key: string]: any;
|
|
2601
|
+
location: {
|
|
2602
|
+
data: Record<string, LocationUpdate>;
|
|
2603
|
+
configure: typeof Location.configure;
|
|
2604
|
+
apply: typeof Location.apply;
|
|
2214
2605
|
};
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
ingredients?: string[];
|
|
2221
|
-
ingredient_alternatives?: Record<string, string[]>;
|
|
2222
|
-
tags?: string[];
|
|
2223
|
-
[key: string]: any;
|
|
2606
|
+
bodywriting: {
|
|
2607
|
+
data: Record<string, BodywritingData>;
|
|
2608
|
+
add: typeof Bodywriting.add;
|
|
2609
|
+
delete: typeof Bodywriting.delete;
|
|
2610
|
+
apply: typeof Bodywriting.apply;
|
|
2224
2611
|
};
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
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;
|
|
2229
2619
|
};
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
addFoodstuff:
|
|
2269
|
-
applyFoodstuff:
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
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
|
+
}> & {
|
|
2637
|
+
traitsData: TraitConfig[];
|
|
2638
|
+
addTraits: typeof Traits.add;
|
|
2639
|
+
injectTraits: (data: Parameters<typeof Traits.inject>[0]) => TraitCategory[];
|
|
2640
|
+
} & {
|
|
2641
|
+
locationData: Record<string, LocationUpdate>;
|
|
2642
|
+
configureLocation: typeof Location.configure;
|
|
2643
|
+
applyLocation: typeof Location.apply;
|
|
2644
|
+
} & {
|
|
2645
|
+
bodywritingData: Record<string, BodywritingData>;
|
|
2646
|
+
addBodywriting: typeof Bodywriting.add;
|
|
2647
|
+
deleteBodywriting: typeof Bodywriting.delete;
|
|
2648
|
+
applyBodywriting: typeof Bodywriting.apply;
|
|
2649
|
+
} & {
|
|
2650
|
+
fishData: Record<string, FishConfig>;
|
|
2651
|
+
fishingLocationData: Partial<Record<FishingLocation, Record<string, number>>>;
|
|
2652
|
+
addFish: typeof Fishing.addFish;
|
|
2653
|
+
addBait: typeof Fishing.addBait;
|
|
2654
|
+
configureFishingLocation: typeof Fishing.configureLocation;
|
|
2655
|
+
applyFishing: typeof Fishing.apply;
|
|
2656
|
+
} & {
|
|
2657
|
+
foodstuffData: Record<string, FoodstuffConfig>;
|
|
2658
|
+
addFoodstuff: typeof Foodstuff.add;
|
|
2659
|
+
applyFoodstuff: typeof Foodstuff.apply;
|
|
2660
|
+
} & {
|
|
2661
|
+
antiquesData: Record<string, AntiqueConfig>;
|
|
2662
|
+
addAntiques: typeof Antiques.add;
|
|
2663
|
+
injectAntiques: typeof Antiques.inject;
|
|
2664
|
+
} & {
|
|
2665
|
+
tipsData: Record<string, string[]>;
|
|
2666
|
+
addTips: typeof Tips.add;
|
|
2667
|
+
applyTips: typeof Tips.apply;
|
|
2668
|
+
injectTips: typeof Tips.inject;
|
|
2669
|
+
}) & {
|
|
2670
|
+
traits: {
|
|
2671
|
+
data: TraitConfig[];
|
|
2672
|
+
add: typeof Traits.add;
|
|
2673
|
+
inject: (data: Parameters<typeof Traits.inject>[0]) => TraitCategory[];
|
|
2674
|
+
};
|
|
2675
|
+
location: {
|
|
2676
|
+
data: Record<string, LocationUpdate>;
|
|
2677
|
+
configure: typeof Location.configure;
|
|
2678
|
+
apply: typeof Location.apply;
|
|
2679
|
+
};
|
|
2680
|
+
bodywriting: {
|
|
2681
|
+
data: Record<string, BodywritingData>;
|
|
2682
|
+
add: typeof Bodywriting.add;
|
|
2683
|
+
delete: typeof Bodywriting.delete;
|
|
2684
|
+
apply: typeof Bodywriting.apply;
|
|
2685
|
+
};
|
|
2686
|
+
fishing: {
|
|
2687
|
+
data: Record<string, FishConfig>;
|
|
2688
|
+
locations: Partial<Record<FishingLocation, Record<string, number>>>;
|
|
2689
|
+
add: typeof Fishing.addFish;
|
|
2690
|
+
addBait: typeof Fishing.addBait;
|
|
2691
|
+
configure: typeof Fishing.configureLocation;
|
|
2692
|
+
apply: typeof Fishing.apply;
|
|
2693
|
+
};
|
|
2694
|
+
foodstuff: {
|
|
2695
|
+
data: Record<string, FoodstuffConfig>;
|
|
2696
|
+
add: typeof Foodstuff.add;
|
|
2697
|
+
apply: typeof Foodstuff.apply;
|
|
2698
|
+
};
|
|
2699
|
+
antiques: {
|
|
2700
|
+
data: Record<string, AntiqueConfig>;
|
|
2701
|
+
add: typeof Antiques.add;
|
|
2702
|
+
inject: typeof Antiques.inject;
|
|
2703
|
+
};
|
|
2704
|
+
tips: {
|
|
2705
|
+
data: Record<string, string[]>;
|
|
2706
|
+
add: typeof Tips.add;
|
|
2707
|
+
apply: typeof Tips.apply;
|
|
2708
|
+
inject: typeof Tips.inject;
|
|
2709
|
+
};
|
|
2710
|
+
};
|
|
2711
|
+
type Patches = ReturnType<typeof create>;
|
|
2274
2712
|
//#endregion
|
|
2275
2713
|
//#region src/modules/ToolCollection.d.ts
|
|
2276
2714
|
declare class ToolCollection {
|
|
@@ -2282,17 +2720,12 @@ declare class ToolCollection {
|
|
|
2282
2720
|
readonly text: htmlTools;
|
|
2283
2721
|
readonly zone: zonesManager;
|
|
2284
2722
|
readonly link: typeof applyLinkZone;
|
|
2285
|
-
readonly patch:
|
|
2723
|
+
readonly patch: Patches;
|
|
2286
2724
|
readonly createlog: typeof createlog;
|
|
2287
2725
|
constructor(core: MaplebirchCore);
|
|
2288
2726
|
onInit(...widgets: InitFunction[]): void;
|
|
2289
|
-
addTo(zone: string, ...widgets:
|
|
2727
|
+
addTo(zone: string, ...widgets: ZoneWidget[]): void;
|
|
2290
2728
|
preInit(): void;
|
|
2291
|
-
private config;
|
|
2292
|
-
private loadConfig;
|
|
2293
|
-
private addTrait;
|
|
2294
|
-
private addKeyedConfig;
|
|
2295
|
-
private error;
|
|
2296
2729
|
}
|
|
2297
2730
|
//#endregion
|
|
2298
2731
|
//#region src/modules/AudioAddon/Track.d.ts
|
|
@@ -2351,8 +2784,8 @@ declare const PlayState: {
|
|
|
2351
2784
|
type PlayStateType = (typeof PlayState)[keyof typeof PlayState];
|
|
2352
2785
|
interface AudioEventData {
|
|
2353
2786
|
type: string;
|
|
2354
|
-
data?:
|
|
2355
|
-
[key: string]:
|
|
2787
|
+
data?: unknown[];
|
|
2788
|
+
[key: string]: unknown;
|
|
2356
2789
|
}
|
|
2357
2790
|
type AudioEventHandler = (eventData: AudioEventData) => void;
|
|
2358
2791
|
interface AudioProgress {
|
|
@@ -2376,6 +2809,7 @@ declare class AudioManager {
|
|
|
2376
2809
|
readonly log: ReturnType<typeof createlog>;
|
|
2377
2810
|
private readonly STORE;
|
|
2378
2811
|
private readonly playlists;
|
|
2812
|
+
private readonly playlistLoads;
|
|
2379
2813
|
private readonly eventListeners;
|
|
2380
2814
|
private readonly cache;
|
|
2381
2815
|
private readonly pendingLoads;
|
|
@@ -2587,7 +3021,7 @@ declare class Transformation {
|
|
|
2587
3021
|
readonly suppressConditions: Record<string, SuppressCondition[]>;
|
|
2588
3022
|
readonly buildUpdaters: Record<string, BuildUpdater>;
|
|
2589
3023
|
constructor(manager: Character);
|
|
2590
|
-
private isDoLP;
|
|
3024
|
+
private get isDoLP();
|
|
2591
3025
|
private get animalTransforms();
|
|
2592
3026
|
private get animalMacros();
|
|
2593
3027
|
private get historyTransforms();
|
|
@@ -2596,6 +3030,7 @@ declare class Transformation {
|
|
|
2596
3030
|
add(name: string, type: string, options: TransformationOption): this;
|
|
2597
3031
|
inject(): void;
|
|
2598
3032
|
private _update;
|
|
3033
|
+
state(): void;
|
|
2599
3034
|
private _clear;
|
|
2600
3035
|
private suppress;
|
|
2601
3036
|
_transform(name: string, change: number): void;
|
|
@@ -2612,7 +3047,7 @@ declare class Transformation {
|
|
|
2612
3047
|
}
|
|
2613
3048
|
): boolean;
|
|
2614
3049
|
get icon(): string;
|
|
2615
|
-
setTransform(name: string, level
|
|
3050
|
+
setTransform(name: string, level?: number | null): void;
|
|
2616
3051
|
part(partName: string): boolean;
|
|
2617
3052
|
}
|
|
2618
3053
|
//#endregion
|
|
@@ -2697,7 +3132,6 @@ interface EnhancedDate extends DateTime {
|
|
|
2697
3132
|
isHour(...hours: number[]): boolean;
|
|
2698
3133
|
isHourBetween(start: number, end: number): boolean;
|
|
2699
3134
|
isMinuteBetween(start: number, end: number): boolean;
|
|
2700
|
-
[key: string]: any;
|
|
2701
3135
|
}
|
|
2702
3136
|
declare class Schedule {
|
|
2703
3137
|
daily: string[];
|
|
@@ -2793,10 +3227,199 @@ declare class NPCSidebarArt {
|
|
|
2793
3227
|
//#region src/modules/NamedNPCAddon/NPCClothes/Condition.d.ts
|
|
2794
3228
|
type Condition = boolean | string | (() => boolean) | Condition[];
|
|
2795
3229
|
//#endregion
|
|
2796
|
-
//#region src/modules/NamedNPCAddon/
|
|
2797
|
-
|
|
2798
|
-
|
|
3230
|
+
//#region src/modules/NamedNPCAddon/NPCSidebarConfig/transformation_layers.d.ts
|
|
3231
|
+
declare const transformationDefaults: {
|
|
3232
|
+
show_tf: boolean;
|
|
3233
|
+
tf_ears_layer: string;
|
|
3234
|
+
angel_wings_type: string;
|
|
3235
|
+
angel_wing_right: string;
|
|
3236
|
+
angel_wing_left: string;
|
|
3237
|
+
angel_wings_layer: string;
|
|
3238
|
+
angel_halo_type: string;
|
|
3239
|
+
angel_halo_lower: boolean;
|
|
3240
|
+
fallen_wings_type: string;
|
|
3241
|
+
fallen_wing_right: string;
|
|
3242
|
+
fallen_wing_left: string;
|
|
3243
|
+
fallen_wings_layer: string;
|
|
3244
|
+
fallen_halo_type: string;
|
|
3245
|
+
demon_wings_type: string;
|
|
3246
|
+
demon_wings_state: string;
|
|
3247
|
+
demon_wings_layer: string;
|
|
3248
|
+
demon_tail_type: string;
|
|
3249
|
+
demon_tail_state: string;
|
|
3250
|
+
demon_tail_layer: string;
|
|
3251
|
+
demon_horns_type: string;
|
|
3252
|
+
demon_horns_layer: string;
|
|
3253
|
+
wolf_tail_type: string;
|
|
3254
|
+
wolf_tail_layer: string;
|
|
3255
|
+
wolf_ears_type: string;
|
|
3256
|
+
wolf_pits_type: string;
|
|
3257
|
+
wolf_pubes_type: string;
|
|
3258
|
+
wolf_cheeks_type: string;
|
|
3259
|
+
cat_tail_type: string;
|
|
3260
|
+
cat_tail_layer: string;
|
|
3261
|
+
cat_ears_type: string;
|
|
3262
|
+
cow_horns_type: string;
|
|
3263
|
+
cow_horns_layer: string;
|
|
3264
|
+
cow_tail_type: string;
|
|
3265
|
+
cow_tail_layer: string;
|
|
3266
|
+
cow_ears_type: string;
|
|
3267
|
+
bird_wings_type: string;
|
|
3268
|
+
bird_wing_right: string;
|
|
3269
|
+
bird_wing_left: string;
|
|
3270
|
+
bird_wings_layer: string;
|
|
3271
|
+
bird_tail_type: string;
|
|
3272
|
+
bird_tail_layer: string;
|
|
3273
|
+
bird_eyes_type: string;
|
|
3274
|
+
bird_malar_type: string;
|
|
3275
|
+
bird_plumage_type: string;
|
|
3276
|
+
bird_pubes_type: string;
|
|
3277
|
+
fox_tail_type: string;
|
|
3278
|
+
fox_tail_layer: string;
|
|
3279
|
+
fox_ears_type: string;
|
|
3280
|
+
fox_cheeks_type: string;
|
|
3281
|
+
};
|
|
3282
|
+
//#endregion
|
|
3283
|
+
//#region src/modules/NamedNPCAddon/NPCSidebarConfig/types.d.ts
|
|
3284
|
+
type NPCBodyData = Pick<
|
|
3285
|
+
NPCData,
|
|
3286
|
+
| 'penis'
|
|
3287
|
+
| 'vagina'
|
|
3288
|
+
| 'virginity'
|
|
3289
|
+
| 'hair_side_type'
|
|
3290
|
+
| 'hair_fringe_type'
|
|
3291
|
+
| 'hair_position'
|
|
3292
|
+
| 'hair_sides_length'
|
|
3293
|
+
| 'hair_fringe_length'
|
|
3294
|
+
| 'eyeColour'
|
|
3295
|
+
| 'hairColour'
|
|
3296
|
+
| 'penissize'
|
|
3297
|
+
| 'breastsize'
|
|
3298
|
+
| 'ballssize'
|
|
3299
|
+
>;
|
|
3300
|
+
type NPCClothesSlot = 'head' | 'face' | 'neck' | 'upper' | 'lower' | 'feet' | 'legs' | 'handheld' | 'genitals' | 'under_upper' | 'under_lower' | 'over_head' | 'over_upper' | 'over_lower' | 'hands';
|
|
3301
|
+
interface NPCSidebarClothing {
|
|
3302
|
+
index: number;
|
|
3303
|
+
name: string;
|
|
3304
|
+
variable: string;
|
|
3305
|
+
type: string[];
|
|
3306
|
+
integrity: string;
|
|
3307
|
+
setup?: NPCSidebarClothing;
|
|
3308
|
+
alpha?: number;
|
|
3309
|
+
alt?: string;
|
|
3310
|
+
altposition?: string;
|
|
3311
|
+
altdisabled?: string[];
|
|
3312
|
+
altsleeve?: string;
|
|
3313
|
+
state?: string;
|
|
3314
|
+
state_top?: string;
|
|
3315
|
+
colour?: string;
|
|
3316
|
+
colourCustom?: string;
|
|
3317
|
+
accessory_colour?: string;
|
|
3318
|
+
accessory_colourCustom?: string;
|
|
3319
|
+
accessory_colour_sidebar?: string;
|
|
3320
|
+
accessory?: number;
|
|
3321
|
+
accessory_integrity_img?: number;
|
|
3322
|
+
mainImage?: number;
|
|
3323
|
+
accImage?: number;
|
|
3324
|
+
leftImage?: number;
|
|
3325
|
+
rightImage?: number;
|
|
3326
|
+
coverImage?: number;
|
|
3327
|
+
coverBackImage?: number;
|
|
3328
|
+
back_img?: number;
|
|
3329
|
+
back_img_acc?: number;
|
|
3330
|
+
back_img_colour?: string;
|
|
3331
|
+
back_img_acc_colour?: string;
|
|
3332
|
+
back_integrity_img?: number;
|
|
3333
|
+
breast_img?: number | Record<number, number>;
|
|
3334
|
+
breast_acc_img?: number | Record<number, number>;
|
|
3335
|
+
breast_pattern?: number;
|
|
3336
|
+
sleeve_img?: number;
|
|
3337
|
+
sleeve_acc_img?: number;
|
|
3338
|
+
sleeve_colour?: string;
|
|
3339
|
+
penis_img?: number;
|
|
3340
|
+
penis_acc_img?: number;
|
|
3341
|
+
mask_img?: number;
|
|
3342
|
+
pattern?: string;
|
|
3343
|
+
pattern_layer?: string;
|
|
3344
|
+
holdPosition?: string;
|
|
3345
|
+
hoodposition?: string;
|
|
3346
|
+
hood?: number;
|
|
3347
|
+
has_collar?: number;
|
|
3348
|
+
high_img?: number;
|
|
3349
|
+
notuck?: number;
|
|
3350
|
+
outfitPrimary?: Partial<Record<NPCClothesSlot, string>>;
|
|
3351
|
+
outfitSecondary?: string[];
|
|
3352
|
+
set?: string;
|
|
3353
|
+
zIndex?: string | number;
|
|
3354
|
+
}
|
|
3355
|
+
interface NPCSidebarState extends Partial<typeof transformationDefaults> {
|
|
3356
|
+
name: string;
|
|
3357
|
+
show: boolean;
|
|
3358
|
+
model: boolean;
|
|
3359
|
+
position: number;
|
|
3360
|
+
dxfn: number;
|
|
3361
|
+
dyfn: number;
|
|
3362
|
+
tan: number;
|
|
3363
|
+
skin_type: string;
|
|
3364
|
+
freckles: boolean;
|
|
3365
|
+
facestyle: string;
|
|
3366
|
+
facevariant: string;
|
|
3367
|
+
ears_position: string;
|
|
3368
|
+
close_up_mask: string;
|
|
3369
|
+
hide_all: boolean;
|
|
3370
|
+
hide_head_acc: boolean;
|
|
3371
|
+
hide_leash: boolean;
|
|
3372
|
+
hood_down: boolean;
|
|
3373
|
+
show_hair: boolean;
|
|
3374
|
+
clothes: Record<NPCClothesSlot, NPCSidebarClothing>;
|
|
3375
|
+
bodydata: NPCBodyData;
|
|
3376
|
+
tf_filters?: Record<string, CanvasLayerFilter>;
|
|
3377
|
+
head_mask: string[];
|
|
3378
|
+
upper_mask: string[];
|
|
3379
|
+
lower_mask: string[];
|
|
3380
|
+
legs_mask: string[];
|
|
3381
|
+
feet_mask: string[];
|
|
3382
|
+
fringe_mask_src: string | null;
|
|
3383
|
+
feet_clip_src: string | null;
|
|
3384
|
+
upper_tucked: boolean;
|
|
3385
|
+
lower_tucked: boolean;
|
|
3386
|
+
crotch_visible: boolean;
|
|
3387
|
+
crotch_exposed: boolean;
|
|
3388
|
+
arm_left: string;
|
|
3389
|
+
arm_right: string;
|
|
3390
|
+
handheld_position: string | null;
|
|
3391
|
+
handheld_animation: string;
|
|
3392
|
+
handheld_overhead: boolean | null;
|
|
3393
|
+
alt_sleeve_state: boolean | null;
|
|
3394
|
+
high_waist_suspenders: boolean | null;
|
|
3395
|
+
hood_mask: boolean | null;
|
|
3396
|
+
zarms: number;
|
|
3397
|
+
zupper: number;
|
|
3398
|
+
zupperleft: number;
|
|
3399
|
+
zupperright: number;
|
|
3400
|
+
lust: number;
|
|
3401
|
+
breasts: string;
|
|
3402
|
+
breast_size: number;
|
|
3403
|
+
penis: string | false;
|
|
3404
|
+
penis_size: number;
|
|
3405
|
+
balls: boolean;
|
|
3406
|
+
genitals_chastity: boolean;
|
|
3407
|
+
eye_colour: string;
|
|
3408
|
+
hair_colour: string;
|
|
3409
|
+
hair_sides_type: string;
|
|
3410
|
+
hair_fringe_type: string;
|
|
3411
|
+
hair_position: string;
|
|
3412
|
+
hair_sides_position: string;
|
|
3413
|
+
hair_sides_length: string;
|
|
3414
|
+
hair_fringe_length: string;
|
|
3415
|
+
drip_mouth: string;
|
|
3416
|
+
calculate_penis_bulge(target?: NPCSidebarState): number;
|
|
3417
|
+
[key: string]: unknown;
|
|
2799
3418
|
}
|
|
3419
|
+
//#endregion
|
|
3420
|
+
//#region src/modules/NamedNPCAddon/NPCClothes/NPCSidebarWardrobe.d.ts
|
|
3421
|
+
type WardrobeClothing = Partial<NPCSidebarClothing>;
|
|
3422
|
+
type WardrobeItem = Partial<Record<NPCClothesSlot, WardrobeClothing>>;
|
|
2800
3423
|
type WardrobeWetness = 'dry' | 'damp' | 'wet' | 'soaked';
|
|
2801
3424
|
type WardrobeWetnessResolver = WardrobeWetness | (() => WardrobeWetness);
|
|
2802
3425
|
interface WardrobeWearOptions {
|
|
@@ -2827,7 +3450,7 @@ declare class NPCSidebarWardrobe {
|
|
|
2827
3450
|
wet(npcName: string, wetness: WardrobeWetnessResolver, cond?: Condition): void;
|
|
2828
3451
|
layer(npcName: string, source: WardrobeLayerResolver, cond?: Condition): void;
|
|
2829
3452
|
put(clothes: WardrobeItem, key: string): void;
|
|
2830
|
-
strip(clothes: WardrobeItem, slot:
|
|
3453
|
+
strip(clothes: WardrobeItem, slot: NPCClothesSlot | readonly NPCClothesSlot[]): void;
|
|
2831
3454
|
base(npcName: string, modifier: WardrobeModifier): void;
|
|
2832
3455
|
modify(npcName: string, modifier: WardrobeModifier): void;
|
|
2833
3456
|
worn(npcName: string): WardrobeItem;
|
|
@@ -2860,7 +3483,7 @@ interface NPCSidebarBootConfig {
|
|
|
2860
3483
|
config?: string[];
|
|
2861
3484
|
}
|
|
2862
3485
|
declare function config(manager: NPCManager, modName: string, modZip: ModZipReader, config: NPCSidebarBootConfig): Promise<void>;
|
|
2863
|
-
declare function loadFromMod(modZip: ModZipReader,
|
|
3486
|
+
declare function loadFromMod(modZip: ModZipReader, npc_names: string[]): string[];
|
|
2864
3487
|
declare class NPCPet {
|
|
2865
3488
|
private readonly pets;
|
|
2866
3489
|
private frame;
|
|
@@ -2881,16 +3504,19 @@ declare const NPCSidebar: {
|
|
|
2881
3504
|
};
|
|
2882
3505
|
//#endregion
|
|
2883
3506
|
//#region src/modules/NamedNPCAddon/NPCFluids.d.ts
|
|
2884
|
-
type NPCFluidPart = 'vagina' | 'anus' | 'mouth' | 'chest' | 'face' | 'feet' | 'leftarm' | 'rightarm' | 'neck' | 'thigh' | 'tummy';
|
|
2885
|
-
type
|
|
3507
|
+
type NPCFluidPart = 'vagina' | 'vaginaoutside' | 'anus' | 'mouth' | 'penis' | 'chest' | 'face' | 'hair' | 'bottom' | 'feet' | 'leftarm' | 'rightarm' | 'neck' | 'thigh' | 'tummy';
|
|
3508
|
+
type NPCFluidType = 'goo' | 'semen';
|
|
3509
|
+
type NPCFluidAmount = [goo: number, semen: number];
|
|
3510
|
+
type NPCFluidData = Record<NPCFluidPart, NPCFluidAmount>;
|
|
2886
3511
|
declare class NPCFluids {
|
|
2887
3512
|
readonly parts: NPCFluidPart[];
|
|
2888
3513
|
ensure(npcName: string): NPCFluidData;
|
|
2889
3514
|
get(npcName: string): NPCFluidData;
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
3515
|
+
combined(npcName: string, part: NPCFluidPart): number;
|
|
3516
|
+
set(npcName: string, part: NPCFluidPart, value: number, type?: NPCFluidType): NPCFluidData;
|
|
3517
|
+
add(npcName: string, part: NPCFluidPart, value?: number, type?: NPCFluidType): NPCFluidData;
|
|
3518
|
+
reduce(npcName: string, part: NPCFluidPart, value?: number, type?: NPCFluidType): NPCFluidData;
|
|
3519
|
+
clear(npcName: string, part?: NPCFluidPart, type?: NPCFluidType): NPCFluidData;
|
|
2894
3520
|
decay(value?: number): void;
|
|
2895
3521
|
apply(nnpc: Record<string, any>, npcData: any): void;
|
|
2896
3522
|
}
|
|
@@ -2900,19 +3526,31 @@ interface NPCTransformationState {
|
|
|
2900
3526
|
build: number;
|
|
2901
3527
|
level: number;
|
|
2902
3528
|
}
|
|
3529
|
+
type NPCTransformationPart = { [Key in keyof typeof transformationDefaults]: Key extends `${infer Part}_type` ? Part : never }[keyof typeof transformationDefaults];
|
|
3530
|
+
interface NPCTransformationPartConfig {
|
|
3531
|
+
level?: number;
|
|
3532
|
+
style?: string;
|
|
3533
|
+
filter?: {
|
|
3534
|
+
blend?: string;
|
|
3535
|
+
blendMode?: string;
|
|
3536
|
+
brightness?: number;
|
|
3537
|
+
contrast?: number;
|
|
3538
|
+
desaturate?: boolean;
|
|
3539
|
+
};
|
|
3540
|
+
}
|
|
2903
3541
|
interface NPCTransformationConfig {
|
|
2904
|
-
levels?: number[];
|
|
3542
|
+
levels?: readonly number[];
|
|
2905
3543
|
type?: string;
|
|
2906
|
-
|
|
2907
|
-
body?: (bodydata:
|
|
2908
|
-
sidebar?: (nnpc:
|
|
3544
|
+
parts?: Partial<Record<NPCTransformationPart, NPCTransformationPartConfig>>;
|
|
3545
|
+
body?: (bodydata: NPCBodyData, state: Readonly<NPCTransformationState>, npcName: string) => void;
|
|
3546
|
+
sidebar?: (nnpc: Partial<NPCSidebarState>, state: Readonly<NPCTransformationState>, npcName: string) => void;
|
|
2909
3547
|
layers?: CanvasLayerMap;
|
|
2910
3548
|
}
|
|
2911
3549
|
declare class NPCTransformation {
|
|
2912
3550
|
private readonly manager;
|
|
2913
3551
|
private readonly configs;
|
|
2914
3552
|
constructor(manager: NPCManager);
|
|
2915
|
-
add(type: string, config?: NPCTransformationConfig): this;
|
|
3553
|
+
add(npcName: string, type: string, config?: NPCTransformationConfig): this;
|
|
2916
3554
|
ensure(npcName: string, type?: string): Record<string, NPCTransformationState>;
|
|
2917
3555
|
get(npcName: string, type: string): NPCTransformationState;
|
|
2918
3556
|
build(npcName: string, type: string, value: number): NPCTransformationState;
|
|
@@ -2920,12 +3558,123 @@ declare class NPCTransformation {
|
|
|
2920
3558
|
clear(npcName: string, type?: string): void;
|
|
2921
3559
|
level(npcName: string, type: string): number;
|
|
2922
3560
|
type(npcName: string): string;
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
3561
|
+
applyBody(
|
|
3562
|
+
nnpc: Partial<NPCSidebarState>,
|
|
3563
|
+
npcData: {
|
|
3564
|
+
bodydata?: NPCBodyData;
|
|
3565
|
+
}
|
|
3566
|
+
): void;
|
|
3567
|
+
applySidebar(nnpc: Partial<NPCSidebarState>): void;
|
|
3568
|
+
private read;
|
|
3569
|
+
private entries;
|
|
3570
|
+
private config;
|
|
2926
3571
|
private active;
|
|
2927
3572
|
}
|
|
2928
3573
|
//#endregion
|
|
3574
|
+
//#region src/modules/NamedNPCAddon/NPCPregnancy.d.ts
|
|
3575
|
+
type NPCPregnancySpecies = 'human' | 'wolf' | 'wolfboy' | 'wolfgirl' | 'hawk' | 'harpy';
|
|
3576
|
+
type NPCPregnancyOrifice = 'vagina' | 'anus';
|
|
3577
|
+
type NPCPregnancyRange = number | readonly [min: number, max: number];
|
|
3578
|
+
interface NPCPregnancyState {
|
|
3579
|
+
enabled?: boolean;
|
|
3580
|
+
analEnabled?: boolean;
|
|
3581
|
+
cycleDaysTotal?: number;
|
|
3582
|
+
cycleDay?: number;
|
|
3583
|
+
cycleDangerousDay?: number;
|
|
3584
|
+
fertileLeadDays?: number;
|
|
3585
|
+
pills?: 'contraceptive' | 'fertility' | null;
|
|
3586
|
+
[key: string]: unknown;
|
|
3587
|
+
}
|
|
3588
|
+
interface NPCPregnancyRecord {
|
|
3589
|
+
pregnancyId: number;
|
|
3590
|
+
carrier: string;
|
|
3591
|
+
carrierSpecies: string;
|
|
3592
|
+
donor: string;
|
|
3593
|
+
donorSpecies: NPCPregnancySpecies;
|
|
3594
|
+
possibleDonors: {
|
|
3595
|
+
name: string;
|
|
3596
|
+
species: NPCPregnancySpecies;
|
|
3597
|
+
}[];
|
|
3598
|
+
conceivedDate: number;
|
|
3599
|
+
conceivedLocation: string;
|
|
3600
|
+
gestationVariance: number;
|
|
3601
|
+
orifice: NPCPregnancyOrifice;
|
|
3602
|
+
deliveredDate: number | null;
|
|
3603
|
+
deliveredLocation: string | null;
|
|
3604
|
+
awareOfPregnancy: string[];
|
|
3605
|
+
awareOfCarrier: string[];
|
|
3606
|
+
awareOfDonor: string[];
|
|
3607
|
+
talkedAbout: Record<string, boolean>;
|
|
3608
|
+
playerLearnedFrom: string | null;
|
|
3609
|
+
hatchDelay?: number;
|
|
3610
|
+
layCare?: number;
|
|
3611
|
+
waterBreaking?: boolean;
|
|
3612
|
+
}
|
|
3613
|
+
interface NPCPregnancyCycleConfig {
|
|
3614
|
+
days?: NPCPregnancyRange;
|
|
3615
|
+
dangerousDay?: number;
|
|
3616
|
+
fertileLeadDays?: NPCPregnancyRange;
|
|
3617
|
+
pills?: 'contraceptive' | 'fertility' | null;
|
|
3618
|
+
analEnabled?: boolean;
|
|
3619
|
+
avoidance?: number;
|
|
3620
|
+
}
|
|
3621
|
+
interface NPCPregnancyConfig {
|
|
3622
|
+
canBePregnant?: boolean;
|
|
3623
|
+
canImpregnatePlayer?: boolean;
|
|
3624
|
+
cycle?: NPCPregnancyCycleConfig;
|
|
3625
|
+
}
|
|
3626
|
+
interface NPCTryConceiveOptions {
|
|
3627
|
+
donor?: string;
|
|
3628
|
+
donorSpecies?: NPCPregnancySpecies;
|
|
3629
|
+
orifice?: NPCPregnancyOrifice;
|
|
3630
|
+
depth?: 'outside' | 'imminent' | 'deep';
|
|
3631
|
+
location?: string;
|
|
3632
|
+
fertility?: number;
|
|
3633
|
+
aware?: boolean;
|
|
3634
|
+
donorKnown?: boolean;
|
|
3635
|
+
}
|
|
3636
|
+
interface NPCPregnancySnapshot {
|
|
3637
|
+
cycle: {
|
|
3638
|
+
enabled: boolean;
|
|
3639
|
+
day: number | null;
|
|
3640
|
+
days: number | null;
|
|
3641
|
+
dangerousDay: number | null;
|
|
3642
|
+
fertileLeadDays: number | null;
|
|
3643
|
+
fertility: number;
|
|
3644
|
+
pills: NPCPregnancyState['pills'];
|
|
3645
|
+
analEnabled: boolean;
|
|
3646
|
+
avoidance: number | null;
|
|
3647
|
+
};
|
|
3648
|
+
pregnancies: NPCPregnancyRecord[];
|
|
3649
|
+
progress: number | null;
|
|
3650
|
+
dueDate: number | null;
|
|
3651
|
+
belly: number;
|
|
3652
|
+
}
|
|
3653
|
+
declare class NPCPregnancy {
|
|
3654
|
+
private readonly manager;
|
|
3655
|
+
private readonly configs;
|
|
3656
|
+
private initialized;
|
|
3657
|
+
constructor(manager: NPCManager);
|
|
3658
|
+
get available(): boolean;
|
|
3659
|
+
add(npcName: string, config?: NPCPregnancyConfig): this;
|
|
3660
|
+
init(): void;
|
|
3661
|
+
inject(): void;
|
|
3662
|
+
get(npcName: string): NPCPregnancySnapshot;
|
|
3663
|
+
tryConceive(npcName: string, options?: NPCTryConceiveOptions): NPCPregnancyRecord | null;
|
|
3664
|
+
private applyRegistration;
|
|
3665
|
+
private applyCycle;
|
|
3666
|
+
private validateCycle;
|
|
3667
|
+
private validateRange;
|
|
3668
|
+
private cycleConfigured;
|
|
3669
|
+
private markCycleConfigured;
|
|
3670
|
+
private species;
|
|
3671
|
+
private name;
|
|
3672
|
+
private npc;
|
|
3673
|
+
private requireRuntime;
|
|
3674
|
+
private range;
|
|
3675
|
+
private random;
|
|
3676
|
+
}
|
|
3677
|
+
//#endregion
|
|
2929
3678
|
//#region src/modules/NamedNPC.d.ts
|
|
2930
3679
|
type PronounCode = 'm' | 'f' | 'i' | 'n' | 't';
|
|
2931
3680
|
type TranslationInput = Map<string, Translation> | Record<string, Translation>;
|
|
@@ -2949,7 +3698,8 @@ interface NPCData {
|
|
|
2949
3698
|
hair_side_type?: string;
|
|
2950
3699
|
hair_fringe_type?: string;
|
|
2951
3700
|
hair_position?: string;
|
|
2952
|
-
|
|
3701
|
+
hair_sides_length?: number;
|
|
3702
|
+
hair_fringe_length?: number;
|
|
2953
3703
|
eyeColour?: string;
|
|
2954
3704
|
hairColour?: string;
|
|
2955
3705
|
bottomsize?: number;
|
|
@@ -2964,7 +3714,7 @@ interface NPCData {
|
|
|
2964
3714
|
breastdesc?: string;
|
|
2965
3715
|
ballssize?: number;
|
|
2966
3716
|
outfits?: string[];
|
|
2967
|
-
pregnancy?:
|
|
3717
|
+
pregnancy?: NPCPregnancyState | null;
|
|
2968
3718
|
pregnancyAvoidance?: number;
|
|
2969
3719
|
[key: string]: any;
|
|
2970
3720
|
}
|
|
@@ -2977,7 +3727,14 @@ interface NPCConfig {
|
|
|
2977
3727
|
special?: boolean | (() => boolean);
|
|
2978
3728
|
loveInterest?: boolean | (() => boolean);
|
|
2979
3729
|
romance?: (() => boolean)[];
|
|
2980
|
-
[key: string]:
|
|
3730
|
+
[key: string]: unknown;
|
|
3731
|
+
}
|
|
3732
|
+
interface NPCStatConfig {
|
|
3733
|
+
min?: number;
|
|
3734
|
+
max?: number;
|
|
3735
|
+
default?: number;
|
|
3736
|
+
position?: number | 'first' | 'last' | false;
|
|
3737
|
+
[key: string]: unknown;
|
|
2981
3738
|
}
|
|
2982
3739
|
declare const NamedNPC: {
|
|
2983
3740
|
new (
|
|
@@ -3002,7 +3759,8 @@ declare const NamedNPC: {
|
|
|
3002
3759
|
hair_side_type: string;
|
|
3003
3760
|
hair_fringe_type: string;
|
|
3004
3761
|
hair_position: string;
|
|
3005
|
-
|
|
3762
|
+
hair_sides_length: number;
|
|
3763
|
+
hair_fringe_length: number;
|
|
3006
3764
|
eyeColour: string;
|
|
3007
3765
|
hairColour: string;
|
|
3008
3766
|
pronoun: PronounCode;
|
|
@@ -3022,9 +3780,9 @@ declare const NamedNPC: {
|
|
|
3022
3780
|
ballsdesc: string;
|
|
3023
3781
|
ballssize: number;
|
|
3024
3782
|
outfits: string[];
|
|
3025
|
-
pregnancy:
|
|
3783
|
+
pregnancy: NPCPregnancyState;
|
|
3026
3784
|
pregnancyAvoidance?: number;
|
|
3027
|
-
descCache: Record<string,
|
|
3785
|
+
descCache: Record<string, string>;
|
|
3028
3786
|
setPronouns(): void;
|
|
3029
3787
|
setBodyTraits(data: NPCData): void;
|
|
3030
3788
|
bodyPartdescription(): void;
|
|
@@ -3041,15 +3799,18 @@ declare const NamedNPC: {
|
|
|
3041
3799
|
declare class NPCManager {
|
|
3042
3800
|
readonly core: MaplebirchCore;
|
|
3043
3801
|
readonly log: ReturnType<typeof createlog>;
|
|
3044
|
-
readonly data: Map<
|
|
3802
|
+
readonly data: Map<
|
|
3803
|
+
string,
|
|
3804
|
+
{
|
|
3805
|
+
Data: InstanceType<typeof NamedNPC>;
|
|
3806
|
+
Config: NPCConfig;
|
|
3807
|
+
}
|
|
3808
|
+
>;
|
|
3045
3809
|
NPCNameList: string[];
|
|
3046
3810
|
readonly Transformation: NPCTransformation;
|
|
3047
|
-
readonly
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
readonly customStats: {
|
|
3051
|
-
[x: string]: any;
|
|
3052
|
-
};
|
|
3811
|
+
readonly Pregnancy: NPCPregnancy;
|
|
3812
|
+
readonly type: Record<'loveInterestNpcs' | 'importantNPCs' | 'specialNPCs', string[]>;
|
|
3813
|
+
readonly customStats: Record<string, NPCStatConfig>;
|
|
3053
3814
|
readonly romanceConditions: {
|
|
3054
3815
|
[key: string]: (() => boolean)[];
|
|
3055
3816
|
};
|
|
@@ -3061,13 +3822,11 @@ declare class NPCManager {
|
|
|
3061
3822
|
constructor(core: MaplebirchCore);
|
|
3062
3823
|
add(npcData: NPCData, config?: NPCConfig, translationsData?: TranslationInput): boolean;
|
|
3063
3824
|
addSchedule(npcName: string, config: ScheduleConfig | ScheduleBuilder): Schedule;
|
|
3064
|
-
addStats(statsObject:
|
|
3825
|
+
addStats(statsObject: Record<string, NPCStatConfig>): void;
|
|
3065
3826
|
addClothes(...configs: OutfitSetConfig[]): void;
|
|
3066
3827
|
injectModNPCs(): void;
|
|
3067
|
-
vanillaNPCConfig(npcConfig: NPCConfig):
|
|
3068
|
-
applyStatDefaults(statDefaults:
|
|
3069
|
-
[x: string]: any;
|
|
3070
|
-
};
|
|
3828
|
+
vanillaNPCConfig(npcConfig: Record<string, NPCConfig>): Record<string, NPCConfig>;
|
|
3829
|
+
applyStatDefaults(statDefaults: Record<string, NPCStatConfig>): Record<string, NPCStatConfig>;
|
|
3071
3830
|
vanillaInit(npcName: string): void;
|
|
3072
3831
|
vanillaInject(npcName: string, npcno: number): void;
|
|
3073
3832
|
private config;
|
|
@@ -3078,22 +3837,24 @@ declare class NPCManager {
|
|
|
3078
3837
|
}
|
|
3079
3838
|
//#endregion
|
|
3080
3839
|
//#region src/modules/CombatAddon/CombatAction.d.ts
|
|
3081
|
-
|
|
3840
|
+
declare const actionTypes: readonly ['leftaction', 'rightaction', 'feetaction', 'mouthaction', 'penisaction', 'vaginaaction', 'anusaction', 'chestaction', 'thighaction'];
|
|
3841
|
+
type ActionType = (typeof actionTypes)[number];
|
|
3082
3842
|
type CombatType = 'Default' | 'Self' | 'Struggle' | 'Swarm' | 'Vore' | 'Machine' | 'Tentacle';
|
|
3843
|
+
type ActionValue = string | number;
|
|
3083
3844
|
interface Context {
|
|
3084
3845
|
actionType?: ActionType;
|
|
3085
3846
|
combatType?: CombatType;
|
|
3086
3847
|
encounterType?: CombatType;
|
|
3087
|
-
action?:
|
|
3848
|
+
action?: ActionValue;
|
|
3849
|
+
id?: string;
|
|
3088
3850
|
originalCount?: number;
|
|
3089
|
-
[key: string]: any;
|
|
3090
3851
|
}
|
|
3091
3852
|
interface ActionEntry {
|
|
3092
3853
|
id: string;
|
|
3093
3854
|
actionType: ActionType;
|
|
3094
3855
|
cond: (ctx: Context) => boolean;
|
|
3095
3856
|
display: (ctx: Context) => string;
|
|
3096
|
-
value: (ctx: Context) =>
|
|
3857
|
+
value: (ctx: Context) => ActionValue;
|
|
3097
3858
|
color: (ctx: Context) => string;
|
|
3098
3859
|
difficulty: (ctx: Context) => string;
|
|
3099
3860
|
effect: (ctx: Context) => string;
|
|
@@ -3105,7 +3866,7 @@ interface ActionConfig {
|
|
|
3105
3866
|
actionType: ActionType | ActionType[];
|
|
3106
3867
|
cond: (ctx: Context) => boolean;
|
|
3107
3868
|
display: (ctx: Context) => string;
|
|
3108
|
-
value: (ctx: Context) =>
|
|
3869
|
+
value: (ctx: Context) => ActionValue;
|
|
3109
3870
|
color?: string | ((ctx: Context) => string);
|
|
3110
3871
|
difficulty?: string | ((ctx: Context) => string);
|
|
3111
3872
|
effect?: string | ((ctx: Context) => string);
|
|
@@ -3113,15 +3874,15 @@ interface ActionConfig {
|
|
|
3113
3874
|
order?: number | ((ctx: Context) => number);
|
|
3114
3875
|
}
|
|
3115
3876
|
interface OptionsTable {
|
|
3116
|
-
[key: string]:
|
|
3877
|
+
[key: string]: ActionValue;
|
|
3117
3878
|
}
|
|
3118
3879
|
declare class CombatActions {
|
|
3119
3880
|
readonly actions: ActionEntry[];
|
|
3120
3881
|
reg(...configs: ActionConfig[]): this;
|
|
3121
3882
|
private eval;
|
|
3122
3883
|
patchOptions(optionsTable: OptionsTable, actionType: ActionType, combatType?: CombatType): OptionsTable;
|
|
3123
|
-
color(action:
|
|
3124
|
-
difficulty(action:
|
|
3884
|
+
color(action: ActionValue, encounterType?: CombatType): string | null;
|
|
3885
|
+
difficulty(action: ActionValue, combatType?: CombatType): string | null;
|
|
3125
3886
|
effect(...actionTypes: ActionType[]): string;
|
|
3126
3887
|
}
|
|
3127
3888
|
//#endregion
|
|
@@ -3139,6 +3900,33 @@ declare class CombatManager {
|
|
|
3139
3900
|
//#endregion
|
|
3140
3901
|
//#region src/core.d.ts
|
|
3141
3902
|
interface Extensions {}
|
|
3903
|
+
interface CoreModules {
|
|
3904
|
+
readonly addon: AddonPlugin;
|
|
3905
|
+
readonly dynamic: DynamicManager;
|
|
3906
|
+
readonly tool: ToolCollection;
|
|
3907
|
+
readonly audio: AudioManager;
|
|
3908
|
+
readonly var: Variables;
|
|
3909
|
+
readonly char: Character;
|
|
3910
|
+
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
|
+
}
|
|
3142
3930
|
type Instance = MaplebirchCore & Extensions;
|
|
3143
3931
|
declare class MaplebirchCore {
|
|
3144
3932
|
static meta: {
|
|
@@ -3170,12 +3958,12 @@ declare class MaplebirchCore {
|
|
|
3170
3958
|
clamp: typeof clamp;
|
|
3171
3959
|
loadImage: typeof loadImage;
|
|
3172
3960
|
}>;
|
|
3173
|
-
modList: string[];
|
|
3961
|
+
readonly modList: string[];
|
|
3174
3962
|
readonly manager: {
|
|
3175
3963
|
modSC2DataManager: SC2DataManager;
|
|
3176
3964
|
modLoaderGui: Gui;
|
|
3177
3965
|
};
|
|
3178
|
-
passage:
|
|
3966
|
+
passage: Passage;
|
|
3179
3967
|
readonly yaml: typeof jsyaml;
|
|
3180
3968
|
readonly howler: {
|
|
3181
3969
|
Howl: typeof Howl;
|
|
@@ -3189,22 +3977,26 @@ declare class MaplebirchCore {
|
|
|
3189
3977
|
readonly lang: LanguageManager;
|
|
3190
3978
|
readonly modules: ModuleSystem;
|
|
3191
3979
|
readonly gui: GUIControl;
|
|
3192
|
-
readonly addon:
|
|
3193
|
-
readonly dynamic:
|
|
3194
|
-
readonly tool:
|
|
3195
|
-
readonly audio:
|
|
3196
|
-
readonly var:
|
|
3197
|
-
readonly char:
|
|
3198
|
-
readonly npc:
|
|
3199
|
-
readonly combat:
|
|
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'];
|
|
3200
3988
|
constructor(modSC2DataManager: SC2DataManager, modLoaderGui: Gui);
|
|
3201
|
-
log(msg: string, level?: string, ...objs:
|
|
3202
|
-
on(eventName:
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
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;
|
|
3208
4000
|
t(key: string, space?: boolean): string;
|
|
3209
4001
|
auto(text: string): string;
|
|
3210
4002
|
disabled(modNames: string | string[], reload?: boolean): Promise<boolean>;
|
|
@@ -3216,14 +4008,15 @@ declare class MaplebirchCore {
|
|
|
3216
4008
|
get Language(): string;
|
|
3217
4009
|
set LogLevel(level: string);
|
|
3218
4010
|
get LogLevel(): string;
|
|
3219
|
-
get(name:
|
|
3220
|
-
get
|
|
4011
|
+
get<K extends keyof (CoreModules & Extensions)>(name: K): (CoreModules & Extensions)[K] | undefined;
|
|
4012
|
+
get(name: string): Module | undefined;
|
|
4013
|
+
get dependencyGraph(): DependencyGraph;
|
|
3221
4014
|
get modLoader(): ReturnType<SC2DataManager['getModLoader']>;
|
|
3222
4015
|
get modUtils(): ModUtils;
|
|
3223
4016
|
get gameVersion(): string;
|
|
3224
4017
|
}
|
|
3225
4018
|
declare var maplebirch: Instance;
|
|
3226
|
-
declare function createlog(prefix: string): (message: string, level?: string, ...objects:
|
|
4019
|
+
declare function createlog(prefix: string): (message: string, level?: string, ...objects: unknown[]) => void;
|
|
3227
4020
|
//#endregion
|
|
3228
4021
|
//#region src/services/CredentialVault.d.ts
|
|
3229
4022
|
type CredentialPeriod = 'day' | 'month';
|
|
@@ -3257,7 +4050,7 @@ interface CryptContext {
|
|
|
3257
4050
|
payload?: AuthPayload;
|
|
3258
4051
|
}
|
|
3259
4052
|
interface CryptResult {
|
|
3260
|
-
data:
|
|
4053
|
+
data: Awaited<InputFileFormat>;
|
|
3261
4054
|
auth?: AuthConfig | boolean | void;
|
|
3262
4055
|
}
|
|
3263
4056
|
interface CryptOptions {
|
|
@@ -3270,8 +4063,8 @@ interface CryptOptions {
|
|
|
3270
4063
|
prompt?: AuthConfig['prompt'] & {
|
|
3271
4064
|
name?: string;
|
|
3272
4065
|
};
|
|
3273
|
-
lazyOptions?:
|
|
3274
|
-
decrypt(password: string, context: CryptContext): Promise<CryptResult |
|
|
4066
|
+
lazyOptions?: unknown;
|
|
4067
|
+
decrypt(password: string, context: CryptContext): Promise<CryptResult | Awaited<InputFileFormat>>;
|
|
3275
4068
|
}
|
|
3276
4069
|
declare class CredentialVault {
|
|
3277
4070
|
readonly core: MaplebirchCore;
|
|
@@ -3301,6 +4094,21 @@ declare class CredentialVault {
|
|
|
3301
4094
|
type Replacement = [RegExp, string];
|
|
3302
4095
|
declare function replace(content: string, replacements: Replacement[], label?: string): string;
|
|
3303
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;
|
|
4110
|
+
}
|
|
4111
|
+
//#endregion
|
|
3304
4112
|
//#region src/modules/AddonPlugin.d.ts
|
|
3305
4113
|
interface FileItem {
|
|
3306
4114
|
modName: string;
|
|
@@ -3320,6 +4128,8 @@ declare class AddonPlugin {
|
|
|
3320
4128
|
readonly replace: typeof replace;
|
|
3321
4129
|
readonly SC2DataManager: SC2DataManager;
|
|
3322
4130
|
readonly modUtils: ModUtils;
|
|
4131
|
+
readonly resources: Resources;
|
|
4132
|
+
readonly diagnostics: Diagnostics;
|
|
3323
4133
|
readonly info: Map<
|
|
3324
4134
|
string,
|
|
3325
4135
|
{
|
|
@@ -3340,6 +4150,7 @@ declare class AddonPlugin {
|
|
|
3340
4150
|
private scriptFilesExecuted;
|
|
3341
4151
|
private bootReady;
|
|
3342
4152
|
constructor(core: MaplebirchCore);
|
|
4153
|
+
wikify(name: string, callbacks: WikifyTracerCallback): void;
|
|
3343
4154
|
hook<T>(name: string, handler: BootHandler<T>): boolean;
|
|
3344
4155
|
canLoadThisMod(bootJson: ModBootJson, _zip: JSZipLikeReadOnlyInterface): Promise<boolean>;
|
|
3345
4156
|
afterInjectEarlyLoad(): Promise<void>;
|
|
@@ -3368,8 +4179,6 @@ declare class AddonPlugin {
|
|
|
3368
4179
|
private run;
|
|
3369
4180
|
private config;
|
|
3370
4181
|
private modifyOptionsDateFormat;
|
|
3371
|
-
private saveHandle;
|
|
3372
|
-
private error;
|
|
3373
4182
|
}
|
|
3374
4183
|
//#endregion
|
|
3375
|
-
export { type Extensions, type MaplebirchCore, maplebirch as default, index_d_exports as utils };
|
|
4184
|
+
export { type CoreEvents, type CoreModules, type Extensions, type MaplebirchCore, type Save, type SaveObject, maplebirch as default, index_d_exports as utils };
|